7 Commits

6 changed files with 137 additions and 34 deletions

54
flake.lock generated
View File

@@ -35,15 +35,15 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1761588595,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra",
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
@@ -61,11 +61,11 @@
]
},
"locked": {
"lastModified": 1763988335,
"narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
"lastModified": 1772665116,
"narHash": "sha256-XmjUDG/J8Z8lY5DVNVUf5aoZGc400FxcjsNCqHKiKtc=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
"rev": "39f53203a8458c330f61cc0759fe243f0ac0d198",
"type": "github"
},
"original": {
@@ -103,11 +103,11 @@
]
},
"locked": {
"lastModified": 1764536451,
"narHash": "sha256-BgtcUkBfItu9/yU14IgUaj4rYOanTOUZjUfBP20/ZB4=",
"lastModified": 1772633058,
"narHash": "sha256-SO7JapRy2HPhgmqiLbfnW1kMx5rakPMKZ9z3wtRLQjI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3fdd076e08049a9c7a83149b270440d9787d2df5",
"rev": "080657a04188aca25f8a6c70a0fb2ea7e37f1865",
"type": "github"
},
"original": {
@@ -140,11 +140,11 @@
},
"nixos": {
"locked": {
"lastModified": 1764831616,
"narHash": "sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA=",
"lastModified": 1772598333,
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c97c47f2bac4fa59e2cbdeba289686ae615f8ed4",
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
"type": "github"
},
"original": {
@@ -156,11 +156,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1764522689,
"narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=",
"lastModified": 1772598333,
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f",
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
"type": "github"
},
"original": {
@@ -177,11 +177,11 @@
]
},
"locked": {
"lastModified": 1764594740,
"narHash": "sha256-YLyM7w1j7BcOK9F+L7x7iY9wfOzPfcIBWW9LeU9Wzoo=",
"lastModified": 1769036658,
"narHash": "sha256-bia1yOQtC8A7XZRCTdLvY0Bdv4i/V6hMqb0NM/9h/jc=",
"ref": "refs/heads/master",
"rev": "878c87430f5e3c109f183a1822988b1c32413131",
"revCount": 51,
"rev": "9c1eb1b999522b965ce129043c7112fc9e38c75a",
"revCount": 52,
"type": "git",
"url": "https://git.project-cloud.net/asmir/nvim_flake"
},
@@ -236,11 +236,11 @@
]
},
"locked": {
"lastModified": 1764381008,
"narHash": "sha256-s+/BuhPPSJHpPRcylqfW+3UFyYsHjAhKdtPSxusYn0U=",
"lastModified": 1772763116,
"narHash": "sha256-5NUtdVWnEflm829QI0BIj2rDhI+pfagt+cxIARJEhi8=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "76bd7a85e78a9b8295782a9cf719ec3489d8eb55",
"rev": "c04152fa90ba5079f4517aa24383245937e43ab8",
"type": "gitlab"
},
"original": {
@@ -256,11 +256,11 @@
]
},
"locked": {
"lastModified": 1764483358,
"narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=",
"lastModified": 1772495394,
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "5aca6ff67264321d47856a2ed183729271107c9c",
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
"type": "github"
},
"original": {

View File

@@ -4,6 +4,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixos.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs_unstable.url = "nixpkgs/nixos-unstable";
nix-xilinx = {
url = "gitlab:asmir.abdulahovic/nix-xilinx";
@@ -44,6 +45,11 @@
url = "git+https://git.project-cloud.net/asmir/project-cloud";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-inventree = {
url = "github:Gigahawk/nixos-inventree";
inputs.nixpkgs.follows = "nixpkgs_unstable";
};
};
outputs =
@@ -57,6 +63,7 @@
, swaysw
, zremap
, nixos
, nixos-inventree
, ...
}:
let
@@ -178,6 +185,7 @@
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
nixos-inventree.nixosModules.default
./magpie/configuration.nix
./magpie/hardware-configuration.nix
simple-nixos-mailserver.nixosModule

View File

@@ -3,6 +3,7 @@
, pkgs
, system
, zremap
, lib
, ...
}:
let
@@ -397,6 +398,7 @@ in
power-profiles-daemon.enable = false;
printing.enable = true;
userborn.enable = true;
upower.enable = lib.mkForce false;
greetd = {
enable = true;
@@ -479,21 +481,19 @@ in
# For your Fujitsu U9313X - Intel 13th gen
#CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
#CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_performance";
CPU_SCALING_MAX_FREQ_ON_AC = 4700000;
CPU_SCALING_MAX_FREQ_ON_BAT = 3000000;
CPU_SCALING_MIN_FREQ_ON_AC = 400000;
CPU_SCALING_MIN_FREQ_ON_BAT = 400000;
# Optional: CPU boost control
CPU_SCALING_MAX_FREQ_ON_BAT = 3200000;
CPU_BOOST_ON_BAT = 1;
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
};
};
batteryNotifier = {
enable = true;
enable = false;
notifyCapacity = 12;
suspendCapacity = 5;
};

View File

@@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
{
home.sessionVariables = {
/*ZDOTDIR = "\"$HOME/\".config/zsh";*/
@@ -115,6 +115,21 @@
if [[ -n "$BUBBLEWRAP_DIR" ]]; then
RPS1="{{$BUBBLEWRAP_DIR}}"
fi
# Recompile .zcompdump if stale
if [[ -f ~/.zcompdump && ( ! -f ~/.zcompdump.zwc || ~/.zcompdump -nt ~/.zcompdump.zwc ) ]]; then
zcompile ~/.zcompdump
fi
'';
};
home.activation.zshRecompile = lib.mkIf config.programs.zsh.enable (
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
for f in "$HOME/.zshrc" "$HOME/.zshenv" "$HOME/.zprofile" "$HOME/.zlogin"; do
if [[ -f "$f" ]]; then
${pkgs.zsh}/bin/zsh -c "zcompile $f" 2>/dev/null || true
fi
done
''
);
}

View File

@@ -1,5 +1,6 @@
{ lib
, pkgs
, config
, ...
}:
let

View File

@@ -224,6 +224,23 @@
proxyPass = "http://localhost:8002/";
};
};
virtualHosts."inventree.project-cloud.net" = {
quic = true;
http3 = true;
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8004";
proxyWebsockets = true;
};
locations."/static/" = {
alias = "/var/lib/inventree/static/";
};
locations."/media/" = {
alias = "/var/lib/inventree/media/";
};
};
};
services.gitea = {
@@ -296,6 +313,68 @@
startAt = "daily";
};
services.inventree = {
enable = true;
# IP and port for gunicorn to bind to
bindIp = "127.0.0.1";
bindPort = 8004;
# Or override the full bind string for e.g. unix sockets:
# serverBind = "unix:/run/inventree/inventree.sock";
# Where InvenTree stores its data (default: /var/lib/inventree)
dataDir = "/var/lib/inventree";
# Systemd timeout for migrations (can be slow on upgrades)
serverStartTimeout = "10min";
serverStopTimeout = "5min";
# config.yaml options — freeform, so any key from
# https://docs.inventree.org/en/stable/start/config/ works here
config = {
site_url = "https://inventree.project-cloud.net";
allowed_hosts = [ "*" ];
# Database — defaults to SQLite if not specified
database = {
ENGINE = "django.db.backends.postgresql";
NAME = "inventree";
USER = "inventree";
HOST = "/run/postgresql"; # peer auth via unix socket
PORT = "";
};
# Static/media/backup paths
static_root = "/var/lib/inventree/static";
media_root = "/var/lib/inventree/media";
backup_dir = "/var/lib/inventree/backup";
};
plugins = {
inventree-kicad-plugin = [];
};
# Declarative user management
users = {
admin = {
email = "asmir@project-cloud.net";
is_superuser = true;
password_file = "/tmp/inventree-admin-password";
};
};
};
# If using PostgreSQL:
services.postgresql = {
enable = true;
ensureDatabases = [ "inventree" ];
ensureUsers = [{
name = "inventree";
ensureDBOwnership = true;
}];
};
# needed for sendmail mail functionality
users.users.gitea.extraGroups = [ "postdrop" ];
systemd.services.gitea.serviceConfig = {