Compare commits

..

1 Commits

Author SHA1 Message Date
64fba754f1 magpie/inventree: add module and configuration 2026-03-23 20:14:14 +01:00
10 changed files with 184 additions and 223 deletions

124
flake.lock generated
View File

@@ -61,11 +61,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1778507602, "lastModified": 1772665116,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", "narHash": "sha256-XmjUDG/J8Z8lY5DVNVUf5aoZGc400FxcjsNCqHKiKtc=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a", "rev": "39f53203a8458c330f61cc0759fe243f0ac0d198",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -103,16 +103,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779726825, "lastModified": 1772633058,
"narHash": "sha256-RUkMrREjKDQrA+dA9+xZviGAxM5W1aVdyOr/bSYpHrE=", "narHash": "sha256-SO7JapRy2HPhgmqiLbfnW1kMx5rakPMKZ9z3wtRLQjI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b179bde238977f7d4454fc770b1a727eaf55111c", "rev": "080657a04188aca25f8a6c70a0fb2ea7e37f1865",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-26.05", "ref": "release-25.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -140,48 +140,32 @@
}, },
"nixos": { "nixos": {
"locked": { "locked": {
"lastModified": 1779971959, "lastModified": 1772598333,
"narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=", "narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ec942ba042dad5ef097e2ef3a3effc034241f011", "rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-26.05", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1779971959, "lastModified": 1772598333,
"narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=", "narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ec942ba042dad5ef097e2ef3a3effc034241f011", "rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-26.05", "ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1779560665,
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -193,11 +177,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1780213167, "lastModified": 1769036658,
"narHash": "sha256-50MzkuYn590Tk89/YivGZ8Z8ZtKRXcP+iHqpLv6TYXA=", "narHash": "sha256-bia1yOQtC8A7XZRCTdLvY0Bdv4i/V6hMqb0NM/9h/jc=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "a5224c23744b0a89e32992442bba4cfaa8464d59", "rev": "9c1eb1b999522b965ce129043c7112fc9e38c75a",
"revCount": 54, "revCount": 52,
"type": "git", "type": "git",
"url": "https://git.project-cloud.net/asmir/nvim_flake" "url": "https://git.project-cloud.net/asmir/nvim_flake"
}, },
@@ -228,46 +212,6 @@
"url": "https://git.project-cloud.net/asmir/project-cloud" "url": "https://git.project-cloud.net/asmir/project-cloud"
} }
}, },
"quickshell": {
"inputs": {
"nixpkgs": [
"quickshell_bar",
"nixpkgs"
]
},
"locked": {
"lastModified": 1779430452,
"narHash": "sha256-zTslhsxLqUlRTML506iougTGzyR38Fzhzn7t4KDEuuE=",
"ref": "refs/heads/master",
"rev": "4b4fca3224ab977dc515ac0bb78d00b3dfa71e00",
"revCount": 819,
"type": "git",
"url": "https://git.outfoxxed.me/quickshell/quickshell"
},
"original": {
"type": "git",
"url": "https://git.outfoxxed.me/quickshell/quickshell"
}
},
"quickshell_bar": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"quickshell": "quickshell"
},
"locked": {
"lastModified": 1780212524,
"narHash": "sha256-r+zAR7SijYiQlanbuOKLEItYXfIOnkyQBPl3QoMWLIg=",
"ref": "refs/heads/master",
"rev": "f8a4536a02e9ce2d78eabf8df0b7ccc59b8ebb15",
"revCount": 1,
"type": "git",
"url": "https://git.project-cloud.net/asmir/quickshell_bar"
},
"original": {
"type": "git",
"url": "https://git.project-cloud.net/asmir/quickshell_bar"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
@@ -276,7 +220,6 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nvim": "nvim", "nvim": "nvim",
"project-cloud": "project-cloud", "project-cloud": "project-cloud",
"quickshell_bar": "quickshell_bar",
"simple-nixos-mailserver": "simple-nixos-mailserver", "simple-nixos-mailserver": "simple-nixos-mailserver",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"swaysw": "swaysw", "swaysw": "swaysw",
@@ -293,14 +236,17 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779651513, "lastModified": 1772763116,
"narHash": "sha256-lUmq8sXQzihreq9UMqAkSBy9z9ueZbRnFyltzYVfQ2I=", "narHash": "sha256-5NUtdVWnEflm829QI0BIj2rDhI+pfagt+cxIARJEhi8=",
"type": "tarball", "owner": "simple-nixos-mailserver",
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz" "repo": "nixos-mailserver",
"rev": "c04152fa90ba5079f4517aa24383245937e43ab8",
"type": "gitlab"
}, },
"original": { "original": {
"type": "tarball", "owner": "simple-nixos-mailserver",
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz" "repo": "nixos-mailserver",
"type": "gitlab"
} }
}, },
"sops-nix": { "sops-nix": {
@@ -310,11 +256,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777944972, "lastModified": 1772495394,
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", "narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c", "rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -382,11 +328,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1780166195, "lastModified": 1764579633,
"narHash": "sha256-kqViUrWwIJP7xVCpcZbRk7IygAw/Tll/UmbcAW9zRPk=", "narHash": "sha256-gOD5RMHOB9Fw4T3nk2a95YdU0J24QU3uWUiZVIQza64=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "e1aecedf30f3b3cedd89d84364bd7e548a011bcd", "rev": "b0707744e2b4a077e759145cdbfa8d8d1017e732",
"revCount": 26, "revCount": 25,
"type": "git", "type": "git",
"url": "https://git.project-cloud.net/asmir/zremap" "url": "https://git.project-cloud.net/asmir/zremap"
}, },

View File

@@ -2,8 +2,9 @@
description = "NixOS configuration"; description = "NixOS configuration";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixos.url = "github:nixos/nixpkgs/nixos-26.05"; nixos.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs_unstable.url = "nixpkgs/nixos-unstable";
nix-xilinx = { nix-xilinx = {
url = "gitlab:asmir.abdulahovic/nix-xilinx"; url = "gitlab:asmir.abdulahovic/nix-xilinx";
@@ -20,10 +21,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
quickshell_bar = {
url = "git+https://git.project-cloud.net/asmir/quickshell_bar";
};
nvim = { nvim = {
url = "git+https://git.project-cloud.net/asmir/nvim_flake"; url = "git+https://git.project-cloud.net/asmir/nvim_flake";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -35,12 +32,12 @@
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-26.05"; url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
simple-nixos-mailserver = { simple-nixos-mailserver = {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz"; url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
@@ -48,6 +45,11 @@
url = "git+https://git.project-cloud.net/asmir/project-cloud"; url = "git+https://git.project-cloud.net/asmir/project-cloud";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-inventree = {
url = "github:Gigahawk/nixos-inventree";
inputs.nixpkgs.follows = "nixpkgs_unstable";
};
}; };
outputs = outputs =
@@ -61,6 +63,7 @@
, swaysw , swaysw
, zremap , zremap
, nixos , nixos
, nixos-inventree
, ... , ...
}: }:
let let
@@ -182,6 +185,7 @@
{ _module.args = inputs; } { _module.args = inputs; }
{ _module.args.system = system; } { _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; } { nix.registry.nixpkgs.flake = nixpkgs; }
nixos-inventree.nixosModules.default
./magpie/configuration.nix ./magpie/configuration.nix
./magpie/hardware-configuration.nix ./magpie/hardware-configuration.nix
simple-nixos-mailserver.nixosModule simple-nixos-mailserver.nixosModule

View File

@@ -93,24 +93,11 @@ in
"xe.force_probe=a7a0" "xe.force_probe=a7a0"
"i915.force_probe=!a7a0" "i915.force_probe=!a7a0"
]; ];
#kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl = { kernel.sysctl = {
"net.core.default_qdisc" = "fq"; "net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr"; "net.ipv4.tcp_congestion_control" = "bbr";
"kernel.unprivileged_userns_clone" = "1"; /* Needed with harderned kernel */ "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.efi.canTouchEfiVariables = true;
loader.systemd-boot = { loader.systemd-boot = {
@@ -129,7 +116,6 @@ in
rtkit.enable = true; rtkit.enable = true;
allowSimultaneousMultithreading = true; allowSimultaneousMultithreading = true;
sudo.enable = true; sudo.enable = true;
sudo.execWheelOnly = true;
doas.enable = true; doas.enable = true;
doas.extraRules = [ doas.extraRules = [
{ {
@@ -138,10 +124,6 @@ in
persist = true; persist = true;
} }
]; ];
apparmor = {
enable = true;
killUnconfinedConfinables = true;
};
}; };
powerManagement = { powerManagement = {
@@ -152,7 +134,6 @@ in
nftables.enable = true; nftables.enable = true;
firewall = { firewall = {
enable = true; enable = true;
logRefusedConnections = true;
allowedTCPPorts = [ allowedTCPPorts = [
80 80
443 443
@@ -218,8 +199,8 @@ in
nvim.overlays.${system}.overlay nvim.overlays.${system}.overlay
]; ];
environment = { environment = {
#memoryAllocator.provider = "mimalloc"; systemPackages = with pkgs; [ alsa-ucm-conf maliit-keyboard ];
systemPackages = with pkgs; [ maliit-keyboard android-tools ]; variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf}/share/alsa/ucm2";
sessionVariables = { sessionVariables = {
LIBVA_DRIVER_NAME = "iHD"; LIBVA_DRIVER_NAME = "iHD";
@@ -257,7 +238,7 @@ in
}; };
appimage = { appimage = {
enable = true; enable = true;
binfmt = false; binfmt = true;
}; };
nix-ld = { nix-ld = {
enable = false; enable = false;
@@ -266,13 +247,9 @@ in
zlib zlib
]; ];
}; };
zsh = { zsh.enable = true;
enable = true;
promptInit = "";
enableCompletion = false;
setOptions = [ ];
};
firejail.enable = true; firejail.enable = true;
adb.enable = true;
wireshark.enable = true; wireshark.enable = true;
sway.enable = true; sway.enable = true;
}; };
@@ -440,12 +417,8 @@ in
}; };
}; };
logind.settings.Login = { logind = {
HandlePowerKey = "suspend"; powerKey = "suspend";
HandleLidSwitch = "suspend";
HandleLidSwitchExternalPower = "suspend";
HandleLidSwitchDocked = "ignore";
KillUserProcesses = true;
}; };
desktopManager = { desktopManager = {
@@ -555,13 +528,13 @@ in
{ {
keys = [ 224 ]; keys = [ 224 ];
events = [ "key" ]; events = [ "key" ];
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; command = "${pkgs.light}/bin/light -U 5";
} }
{ {
keys = [ 225 ]; keys = [ 225 ];
events = [ "key" ]; events = [ "key" ];
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%+"; command = "${pkgs.light}/bin/light -A 5";
} }
]; ];
}; };
@@ -625,6 +598,10 @@ in
SystemMaxUse=50M SystemMaxUse=50M
''; '';
logind.settings.Login = {
KillUserProcesses = true;
};
}; };
fonts = { fonts = {
@@ -714,6 +691,7 @@ in
initialHashedPassword = "$y$j9T$FZnEcCEMIC0Fjj4dZi5t8.$D8ygvO19dR5nyTZxWwDgjEimHutD.sKnD1DLAyhU8.B"; initialHashedPassword = "$y$j9T$FZnEcCEMIC0Fjj4dZi5t8.$D8ygvO19dR5nyTZxWwDgjEimHutD.sKnD1DLAyhU8.B";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ extraGroups = [
"adbusers"
"audio" "audio"
"dialout" "dialout"
"input" "input"

View File

@@ -21,14 +21,12 @@
{ {
device = "/dev/mapper/fuji_lvm_root-root"; device = "/dev/mapper/fuji_lvm_root-root";
fsType = "xfs"; fsType = "xfs";
options = [ "noatime" "logbsize=256k" ];
}; };
fileSystems."/home" = fileSystems."/home" =
{ {
device = "/dev/mapper/fuji_lvm_root-home"; device = "/dev/mapper/fuji_lvm_root-home";
fsType = "xfs"; fsType = "xfs";
options = [ "noatime" "logbsize=256k" ];
}; };
fileSystems."/boot" = fileSystems."/boot" =

View File

@@ -25,7 +25,6 @@ let
--hooks ''\'systemctl --user restart lisgd.service''\' --hooks ''\'systemctl --user restart lisgd.service''\'
''; '';
swaysw = inputs.swaysw.packages.${system}.swaysw; swaysw = inputs.swaysw.packages.${system}.swaysw;
quickshell_bar = inputs.quickshell_bar.packages.${system}.default;
term = "${pkgs.foot}/bin/footclient"; term = "${pkgs.foot}/bin/footclient";
in in
{ {
@@ -93,9 +92,19 @@ in
}; };
}; };
bars = [ ]; bars = [
startup = [ {
{ command = "exec ${quickshell_bar}/bin/quickshell-bar"; } position = "top";
fonts = {
names = [
"Iosevka"
"FontAwesome"
];
style = "Bold Semi-Condensed";
size = 12.0;
};
statusCommand = "${lib.getExe pkgs.i3status-rust} ~/.config/i3status-rust/config-top.toml";
}
]; ];
keybindings = { keybindings = {

View File

@@ -10,14 +10,9 @@
enableZshIntegration = true; enableZshIntegration = true;
}; };
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = { programs.zsh = {
autocd = true; autocd = true;
enableCompletion = true; enableCompletion = false;
defaultKeymap = "viins"; defaultKeymap = "viins";
/* dotDir = "\"$XDG_CONFIG_HOME\"/zsh"; */ /* dotDir = "\"$XDG_CONFIG_HOME\"/zsh"; */
@@ -68,6 +63,11 @@
}; };
file = "pure.plugin.zsh"; file = "pure.plugin.zsh";
} }
{
name = "fzf";
src = pkgs.fzf-zsh;
file = "share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh";
}
{ {
name = "zsh-sudo"; name = "zsh-sudo";
src = pkgs.oh-my-zsh; src = pkgs.oh-my-zsh;
@@ -89,7 +89,7 @@
RPS1="" RPS1=""
function chpwd() { function chpwd() {
ls --color=tty; ls;
} }
function osc7-pwd() { function osc7-pwd() {
@@ -104,7 +104,7 @@
} }
add-zsh-hook -Uz chpwd chpwd-osc7-pwd add-zsh-hook -Uz chpwd chpwd-osc7-pwd
#eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then

View File

@@ -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; fonts.fontconfig.enable = true;
home.sessionVariables = rec { home.sessionVariables = rec {
@@ -101,9 +91,6 @@ in
pkgs.mpvScripts.uosc pkgs.mpvScripts.uosc
pkgs.mpvScripts.webtorrent-mpv-hook pkgs.mpvScripts.webtorrent-mpv-hook
]; ];
scriptOpts.webtorrent = {
path = "/tmp";
};
config = { config = {
osc = "no"; osc = "no";
osd-bar = "no"; osd-bar = "no";
@@ -114,16 +101,6 @@ in
vo = "dmabuf-wayland"; vo = "dmabuf-wayland";
ao = "pipewire"; ao = "pipewire";
ytdl-format = "bestvideo[height<=1080]+bestaudio/best[height<=1080]"; 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 = { bindings = {
@@ -181,12 +158,6 @@ in
}; };
settings = { settings = {
# Workaround for QtWebEngine screen flicker/flash on Wayland+Intel
qt.args = [
"disable-gpu-compositing"
"enable-features=VaapiVideoDecoder,VaapiVideoEncoder"
];
colors.webpage.preferred_color_scheme = "dark";
content.notifications.enabled = false; content.notifications.enabled = false;
content.pdfjs = true; content.pdfjs = true;
content.webgl = false; content.webgl = false;
@@ -291,13 +262,22 @@ in
*/ */
{ {
enable = true; enable = true;
events = { events = [
before-sleep = "${locker}/bin/swaylock_fancy"; {
lock = "${locker}/bin/swaylock_fancy"; event = "before-sleep";
command = "${locker}/bin/swaylock_fancy";
}
{
event = "lock";
command = "${locker}/bin/swaylock_fancy";
}
/* /*
after-resume = "${refresh_i3status}/bin/refresh_i3status"; {
event = "after-resume";
command = "${refresh_i3status}/bin/refresh_i3status";
}
*/ */
}; ];
timeouts = [ timeouts = [
{ {
timeout = 15 * 60; timeout = 15 * 60;

View File

@@ -160,7 +160,7 @@ in
ungoogled-chromium ungoogled-chromium
upx upx
viber viber
karere wasistlos
waybar waybar
wdisplays wdisplays
weechat weechat

View File

@@ -27,19 +27,6 @@
boot.kernel.sysctl = { boot.kernel.sysctl = {
"net.core.default_qdisc" = "fq"; "net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr"; "net.ipv4.tcp_congestion_control" = "bbr";
"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;
}; };
boot.initrd = { boot.initrd = {
@@ -62,7 +49,7 @@
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
users.users.root.hashedPassword = "!"; users.users.root.initialHashedPassword = "";
users.users.root.openssh.authorizedKeys.keys = [ users.users.root.openssh.authorizedKeys.keys = [
(builtins.readFile ../nixy/ssh_pubkey) (builtins.readFile ../nixy/ssh_pubkey)
]; ];
@@ -121,14 +108,10 @@
certificateScheme = "acme-nginx"; certificateScheme = "acme-nginx";
}; };
services.journald.extraConfig = ''SystemMaxUse=500M ''; services.journald.extraConfig = ''SystemMaxUse=50M '';
services.logind.settings.Login = { KillUserProcesses = true; }; services.logind.settings.Login = { KillUserProcesses = true; };
services.openssh.settings.PermitRootLogin = "prohibit-password";
services.openssh.enable = true; services.openssh.enable = true;
services.openssh.settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
services.openssh.listenAddresses = [ services.openssh.listenAddresses = [
{ {
addr = "10.100.0.1"; # wireguard addr = "10.100.0.1"; # wireguard
@@ -136,13 +119,6 @@
} }
]; ];
services.fail2ban = {
enable = true;
maxretry = 5;
bantime = "1h";
ignoreIP = [ "10.100.0.0/24" ];
};
services.opendkim = { services.opendkim = {
enable = true; enable = true;
selector = "mail"; selector = "mail";
@@ -248,6 +224,23 @@
proxyPass = "http://localhost:8002/"; 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 = { services.gitea = {
@@ -320,6 +313,68 @@
startAt = "daily"; 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 # needed for sendmail mail functionality
users.users.gitea.extraGroups = [ "postdrop" ]; users.users.gitea.extraGroups = [ "postdrop" ];
systemd.services.gitea.serviceConfig = { systemd.services.gitea.serviceConfig = {
@@ -332,12 +387,6 @@
defaults.email = "asmir.abdulahovic@gmail.com"; defaults.email = "asmir.abdulahovic@gmail.com";
}; };
security.sudo.execWheelOnly = true;
environment.memoryAllocator.provider = "jemalloc";
systemd.coredump.enable = false;
sops = { sops = {
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = { secrets = {
@@ -371,13 +420,14 @@
80 80
443 443
587 587
]; # http, https, submission 2049
]; # http, mail, mail, nfs
allowedUDPPorts = [ allowedUDPPorts = [
443 443
51820 51820
]; # http3, wireguard ]; # mail, wireguard
allowPing = true; allowPing = true;
logRefusedConnections = lib.mkDefault true; logRefusedConnections = lib.mkDefault false;
}; };
networking.nat = { networking.nat = {

View File

@@ -27,10 +27,6 @@ stdenv.mkDerivation rec {
--replace "/var/tmp" "$TMPDIR" --replace "/var/tmp" "$TMPDIR"
''; '';
# GCC 15 (nixpkgs 26.05) defaults to -std=gnu23, where `bool`/`true`/`false`
# are keywords; this old bubblewrap fork still does `typedef int bool;`.
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
nativeBuildInputs = [ nativeBuildInputs = [
docbook_xsl docbook_xsl
libxslt libxslt