Compare commits
1 Commits
1b7c445e4a
...
inventree
| Author | SHA1 | Date | |
|---|---|---|---|
|
64fba754f1
|
49
flake.lock
generated
49
flake.lock
generated
@@ -37,13 +37,13 @@
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "edolstra",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -61,11 +61,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772893680,
|
||||
"narHash": "sha256-JDqZMgxUTCq85ObSaFw0HhE+lvdOre1lx9iI6vYyOEs=",
|
||||
"lastModified": 1772665116,
|
||||
"narHash": "sha256-XmjUDG/J8Z8lY5DVNVUf5aoZGc400FxcjsNCqHKiKtc=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "8baab586afc9c9b57645a734c820e4ac0a604af9",
|
||||
"rev": "39f53203a8458c330f61cc0759fe243f0ac0d198",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -103,11 +103,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777851538,
|
||||
"narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=",
|
||||
"lastModified": 1772633058,
|
||||
"narHash": "sha256-SO7JapRy2HPhgmqiLbfnW1kMx5rakPMKZ9z3wtRLQjI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5",
|
||||
"rev": "080657a04188aca25f8a6c70a0fb2ea7e37f1865",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -140,11 +140,11 @@
|
||||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1778003029,
|
||||
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -156,11 +156,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1778003029,
|
||||
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -236,14 +236,17 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773912645,
|
||||
"narHash": "sha256-QHzRqq6gh+t3F/QU9DkP7X63dDDcuIQmaDz12p7ANTg=",
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-25.11/nixos-mailserver-nixos-25.11.tar.gz"
|
||||
"lastModified": 1772763116,
|
||||
"narHash": "sha256-5NUtdVWnEflm829QI0BIj2rDhI+pfagt+cxIARJEhi8=",
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"rev": "c04152fa90ba5079f4517aa24383245937e43ab8",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-25.11/nixos-mailserver-nixos-25.11.tar.gz"
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
@@ -253,11 +256,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777944972,
|
||||
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=",
|
||||
"lastModified": 1772495394,
|
||||
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c",
|
||||
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
10
flake.nix
10
flake.nix
@@ -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";
|
||||
@@ -36,7 +37,7 @@
|
||||
};
|
||||
|
||||
simple-nixos-mailserver = {
|
||||
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-25.11/nixos-mailserver-nixos-25.11.tar.gz";
|
||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -93,24 +93,11 @@ in
|
||||
"xe.force_probe=a7a0"
|
||||
"i915.force_probe=!a7a0"
|
||||
];
|
||||
#kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernel.sysctl = {
|
||||
"net.core.default_qdisc" = "fq";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"kernel.unprivileged_userns_clone" = "1"; /* Needed with harderned kernel */
|
||||
"kernel.kptr_restrict" = 2;
|
||||
"kernel.dmesg_restrict" = 1;
|
||||
"kernel.kexec_load_disabled" = 1;
|
||||
"kernel.yama.ptrace_scope" = 1;
|
||||
"net.ipv4.conf.all.rp_filter" = 1;
|
||||
"net.ipv4.conf.default.rp_filter" = 1;
|
||||
"net.ipv4.conf.all.log_martians" = 1;
|
||||
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||
"net.ipv4.conf.all.send_redirects" = 0;
|
||||
"net.ipv4.conf.default.send_redirects" = 0;
|
||||
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot = {
|
||||
@@ -129,7 +116,6 @@ in
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = true;
|
||||
sudo.execWheelOnly = true;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
@@ -138,10 +124,6 @@ in
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
apparmor = {
|
||||
enable = true;
|
||||
killUnconfinedConfinables = true;
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
@@ -152,7 +134,6 @@ in
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
logRefusedConnections = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
@@ -218,8 +199,8 @@ in
|
||||
nvim.overlays.${system}.overlay
|
||||
];
|
||||
environment = {
|
||||
#memoryAllocator.provider = "mimalloc";
|
||||
systemPackages = with pkgs; [ maliit-keyboard ];
|
||||
systemPackages = with pkgs; [ alsa-ucm-conf maliit-keyboard ];
|
||||
variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf}/share/alsa/ucm2";
|
||||
|
||||
sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "iHD";
|
||||
@@ -257,7 +238,7 @@ in
|
||||
};
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = false;
|
||||
binfmt = true;
|
||||
};
|
||||
nix-ld = {
|
||||
enable = false;
|
||||
@@ -266,12 +247,7 @@ in
|
||||
zlib
|
||||
];
|
||||
};
|
||||
zsh = {
|
||||
enable = true;
|
||||
promptInit = "";
|
||||
enableCompletion = false;
|
||||
setOptions = [ ];
|
||||
};
|
||||
zsh.enable = true;
|
||||
firejail.enable = true;
|
||||
adb.enable = true;
|
||||
wireshark.enable = true;
|
||||
@@ -441,12 +417,8 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
logind.settings.Login = {
|
||||
HandlePowerKey = "suspend";
|
||||
HandleLidSwitch = "suspend";
|
||||
HandleLidSwitchExternalPower = "suspend";
|
||||
HandleLidSwitchDocked = "ignore";
|
||||
KillUserProcesses = true;
|
||||
logind = {
|
||||
powerKey = "suspend";
|
||||
};
|
||||
|
||||
desktopManager = {
|
||||
@@ -626,6 +598,10 @@ in
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.settings.Login = {
|
||||
KillUserProcesses = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
fonts = {
|
||||
|
||||
@@ -21,14 +21,12 @@
|
||||
{
|
||||
device = "/dev/mapper/fuji_lvm_root-root";
|
||||
fsType = "xfs";
|
||||
options = [ "noatime" "logbsize=256k" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{
|
||||
device = "/dev/mapper/fuji_lvm_root-home";
|
||||
fsType = "xfs";
|
||||
options = [ "noatime" "logbsize=256k" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
programs.zsh = {
|
||||
autocd = true;
|
||||
enableCompletion = true;
|
||||
enableCompletion = false;
|
||||
defaultKeymap = "viins";
|
||||
/* dotDir = "\"$XDG_CONFIG_HOME\"/zsh"; */
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
RPS1=""
|
||||
|
||||
function chpwd() {
|
||||
ls --color=tty;
|
||||
ls;
|
||||
}
|
||||
|
||||
function osc7-pwd() {
|
||||
|
||||
@@ -36,16 +36,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = { name = "Adwaita-dark"; package = pkgs.gnome-themes-extra; };
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
style.name = "adwaita-dark";
|
||||
platformTheme.name = "gtk";
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.sessionVariables = rec {
|
||||
@@ -101,9 +91,6 @@ in
|
||||
pkgs.mpvScripts.uosc
|
||||
pkgs.mpvScripts.webtorrent-mpv-hook
|
||||
];
|
||||
scriptOpts.webtorrent = {
|
||||
path = "/tmp";
|
||||
};
|
||||
config = {
|
||||
osc = "no";
|
||||
osd-bar = "no";
|
||||
@@ -114,16 +101,6 @@ in
|
||||
vo = "dmabuf-wayland";
|
||||
ao = "pipewire";
|
||||
ytdl-format = "bestvideo[height<=1080]+bestaudio/best[height<=1080]";
|
||||
video-osd = "yes";
|
||||
osd-back-color = "0.0/0.0/0.0/0.0";
|
||||
};
|
||||
|
||||
scriptOpts = {
|
||||
uosc = {
|
||||
disable_elements = "buffering_indicator";
|
||||
timeline_style = "bar";
|
||||
top_bar = "no-border";
|
||||
};
|
||||
};
|
||||
|
||||
bindings = {
|
||||
@@ -181,7 +158,6 @@ in
|
||||
};
|
||||
|
||||
settings = {
|
||||
colors.webpage.preferred_color_scheme = "dark";
|
||||
content.notifications.enabled = false;
|
||||
content.pdfjs = true;
|
||||
content.webgl = false;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user