statix fix

This commit is contained in:
Ivan Kirilov Dimitrov 2024-08-07 20:38:52 +02:00
parent dec199a870
commit 67279849d7
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294
6 changed files with 40 additions and 50 deletions

View File

@ -1,4 +1,4 @@
{ ... }: { _: {
flake.hardwareConfigurations = { flake.hardwareConfigurations = {
nova = { lib, modulesPath, ... }: { nova = { lib, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View File

@ -1,7 +1,7 @@
toplevel @ { moduleWithSystem, ... }: { toplevel @ { moduleWithSystem, ... }: {
flake.homeManagerModules = { flake.homeManagerModules = {
base = moduleWithSystem ( base = moduleWithSystem (
{ ... }: { config, ... }: { _: { config, ... }: {
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.stateVersion = toplevel.config.flake.stateVersion; home.stateVersion = toplevel.config.flake.stateVersion;
xdg = { xdg = {
@ -23,7 +23,7 @@ toplevel @ { moduleWithSystem, ... }: {
} }
); );
ivand = moduleWithSystem ( ivand = moduleWithSystem (
{ ... }: { pkgs, ... }: { _: { pkgs, ... }: {
home = { home = {
username = "ivand"; username = "ivand";
homeDirectory = "/home/ivand"; homeDirectory = "/home/ivand";
@ -55,7 +55,7 @@ toplevel @ { moduleWithSystem, ... }: {
} }
); );
util = moduleWithSystem ( util = moduleWithSystem (
{ ... }: { pkgs _: { pkgs
, config , config
, ... , ...
}: { }: {
@ -175,7 +175,7 @@ toplevel @ { moduleWithSystem, ... }: {
} }
); );
shell = moduleWithSystem ( shell = moduleWithSystem (
{ ... }: { pkgs, ... }: { _: { pkgs, ... }: {
programs = programs =
let let
shellAliases = { shellAliases = {
@ -263,7 +263,7 @@ toplevel @ { moduleWithSystem, ... }: {
} }
); );
swayland = moduleWithSystem ( swayland = moduleWithSystem (
{ ... }: { pkgs _: { pkgs
, config , config
, ... , ...
}: { }: {
@ -315,15 +315,14 @@ toplevel @ { moduleWithSystem, ... }: {
}; };
}; };
}; };
swaynag = { enable = config.wayland.windowManager.sway.enable; }; swaynag = { inherit (config.wayland.windowManager.sway) enable; };
}; };
programs = { programs = {
waybar = { waybar = {
enable = true; enable = true;
settings = { settings = {
mainBar = mainBar =
let {
in {
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 30; height = 30;
@ -620,7 +619,7 @@ toplevel @ { moduleWithSystem, ... }: {
} }
); );
web = moduleWithSystem ( web = moduleWithSystem (
{ ... }: { ... }: { _: _: {
programs = { programs = {
browserpass.enable = true; browserpass.enable = true;
firefox = { firefox = {

View File

@ -5,7 +5,7 @@ toplevel @ { inputs
let let
system = "x86_64-linux"; system = "x86_64-linux";
mods = toplevel.config.flake.nixosModules; mods = toplevel.config.flake.nixosModules;
hardwareConfigurations = toplevel.config.flake.hardwareConfigurations; inherit (toplevel.config.flake) hardwareConfigurations;
essential = with mods; [ grub base shell security wireless intranet ]; essential = with mods; [ grub base shell security wireless intranet ];
desktop = with mods; [ sound wayland ]; desktop = with mods; [ sound wayland ];
configWithModules = configWithModules =
@ -13,11 +13,10 @@ let
, modules , modules
, ,
}: }:
withSystem system ({ config, inputs', pkgs, ... }: withSystem system ({ inputs', pkgs, ... }:
inputs.nixpkgs.lib.nixosSystem { inputs.nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs inputs' pkgs; inherit inputs inputs' pkgs;
packages = config.packages;
}; };
modules = [ hardware ] ++ modules; modules = [ hardware ] ++ modules;
}); });

View File

@ -1,6 +1,6 @@
top @ { inputs, moduleWithSystem, ... }: { top @ { inputs, moduleWithSystem, ... }: {
flake.nixosModules = { flake.nixosModules = {
grub = moduleWithSystem ({ ... }: { pkgs, ... }: { grub = moduleWithSystem (_: { pkgs, ... }: {
boot = { boot = {
loader = { loader = {
grub = grub =
@ -11,18 +11,18 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
in in
{ {
inherit theme;
enable = pkgs.lib.mkDefault true; enable = pkgs.lib.mkDefault true;
useOSProber = true; useOSProber = true;
efiSupport = true; efiSupport = true;
device = "nodev"; device = "nodev";
theme = theme;
splashImage = "${theme}/background.png"; splashImage = "${theme}/background.png";
}; };
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
}; };
}); });
base = moduleWithSystem ({ ... }: { pkgs, ... }: { base = moduleWithSystem (_: { pkgs, ... }: {
imports = [ inputs.hosts.nixosModule ]; imports = [ inputs.hosts.nixosModule ];
system.stateVersion = top.config.flake.stateVersion; system.stateVersion = top.config.flake.stateVersion;
nix = { extraOptions = ''experimental-features = nix-command flakes''; }; nix = { extraOptions = ''experimental-features = nix-command flakes''; };
@ -55,7 +55,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
shell = moduleWithSystem ({ ... }: { pkgs, ... }: { shell = moduleWithSystem (_: { pkgs, ... }: {
programs = { programs = {
starship.enable = true; starship.enable = true;
zsh = { zsh = {
@ -83,7 +83,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
sound = moduleWithSystem ({ ... }: { pkgs, ... }: { sound = moduleWithSystem (_: { pkgs, ... }: {
services = { services = {
pipewire = { pipewire = {
enable = true; enable = true;
@ -93,7 +93,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
environment.systemPackages = with pkgs; [ pwvucontrol ]; environment.systemPackages = with pkgs; [ pwvucontrol ];
}); });
music = moduleWithSystem ({ ... }: { pkgs, ... }: { music = moduleWithSystem (_: { pkgs, ... }: {
imports = [ inputs.musnix.nixosModules.musnix ]; imports = [ inputs.musnix.nixosModules.musnix ];
environment.systemPackages = with pkgs; [ guitarix ]; environment.systemPackages = with pkgs; [ guitarix ];
services.pipewire = { services.pipewire = {
@ -110,7 +110,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
wayland = moduleWithSystem ({ ... }: { ... }: { wayland = moduleWithSystem (_: _: {
hardware.graphics.enable = true; hardware.graphics.enable = true;
security.pam.services.swaylock = { }; security.pam.services.swaylock = { };
xdg.portal = { xdg.portal = {
@ -128,7 +128,7 @@ top @ { inputs, moduleWithSystem, ... }: {
config.common.default = "*"; config.common.default = "*";
}; };
}); });
security = moduleWithSystem ({ ... }: { ... }: { security = moduleWithSystem (_: _: {
security = { security = {
sudo = { sudo = {
enable = false; enable = false;
@ -216,7 +216,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}; };
ivand = moduleWithSystem ({ ... }: { pkgs, ... }: ivand = moduleWithSystem (_: { pkgs, ... }:
let let
homeMods = top.config.flake.homeManagerModules; homeMods = top.config.flake.homeManagerModules;
in in
@ -276,17 +276,17 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
services.flatpak.enable = true; services.flatpak.enable = true;
}; };
ai = moduleWithSystem ({ ... }: { ... }: { ai = moduleWithSystem (_: _: {
services = { ollama.enable = true; }; services = { ollama.enable = true; };
}); });
anon = moduleWithSystem ({ ... }: { pkgs, ... }: { anon = moduleWithSystem (_: { pkgs, ... }: {
environment.systemPackages = with pkgs; [ tor-browser ]; environment.systemPackages = with pkgs; [ tor-browser ];
}); });
cryptocurrency = moduleWithSystem ({ ... }: { pkgs, ... }: { cryptocurrency = moduleWithSystem (_: { pkgs, ... }: {
environment.systemPackages = with pkgs; [ monero-cli ]; environment.systemPackages = with pkgs; [ monero-cli ];
services = { monero.enable = true; }; services = { monero.enable = true; };
}); });
monero-miner = moduleWithSystem ({ ... }: { ... }: { monero-miner = moduleWithSystem (_: _: {
services = { services = {
xmrig = { xmrig = {
enable = true; enable = true;
@ -307,15 +307,15 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
vps = moduleWithSystem ({ ... }: { ... }: { vps = moduleWithSystem (_: { ... }: {
imports = [ imports = [
inputs.vpsadminos.nixosConfigurations.container inputs.vpsadminos.nixosConfigurations.container
]; ];
}); });
mailserver = moduleWithSystem ({ ... }: { config mailserver = moduleWithSystem (_: { config
, pkgs , pkgs
, ... , ...
}: { }: {
imports = [ imports = [
inputs.simple-nixos-mailserver.nixosModule inputs.simple-nixos-mailserver.nixosModule
]; ];
@ -374,7 +374,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
nginx = moduleWithSystem ({ ... }: { pkgs, ... }: { nginx = moduleWithSystem (_: { pkgs, ... }: {
services = { services = {
nginx = nginx =
let let
@ -468,7 +468,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
wireguard-output = moduleWithSystem ({ ... }: { pkgs, ... }: { wireguard-output = moduleWithSystem (_: { pkgs, ... }: {
networking = { networking = {
nat = { nat = {
enable = true; enable = true;
@ -516,7 +516,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
anonymous-dns = moduleWithSystem ({ ... }: { ... }: { anonymous-dns = moduleWithSystem (_: _: {
networking = { networking = {
nameservers = [ "127.0.0.1" "::1" ]; nameservers = [ "127.0.0.1" "::1" ];
dhcpcd.extraConfig = "nohook resolv.conf"; dhcpcd.extraConfig = "nohook resolv.conf";
@ -554,7 +554,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
firewall = moduleWithSystem ({ ... }: { lib, ... }: { firewall = moduleWithSystem (_: { lib, ... }: {
networking = { networking = {
firewall = lib.mkForce { firewall = lib.mkForce {
enable = true; enable = true;
@ -587,7 +587,7 @@ top @ { inputs, moduleWithSystem, ... }: {
}; };
}; };
}); });
rest = moduleWithSystem ({ ... }: { pkgs, ... }: { rest = moduleWithSystem (_: { pkgs, ... }: {
fileSystems."/mnt/export1981" = { fileSystems."/mnt/export1981" = {
device = "172.16.128.47:/nas/5490"; device = "172.16.128.47:/nas/5490";
fsType = "nfs"; fsType = "nfs";

View File

@ -1,17 +1,8 @@
{ inputs, withSystem, ... }: { { withSystem, ... }: {
flake.overlays.default = _final: _prev: flake.overlays.default = _: _:
let withSystem "x86_64-linux" (
system = "x86_64-linux"; { config, ... }: with config.packages; {
in inherit nvim bingwp screenshot cursors wpd webshite sal;
withSystem system (
{ config, ... }: {
nvim = config.packages.nvim;
bingwp = config.packages.bingwp;
screenshot = config.packages.screenshot;
cursors = config.packages.cursors;
wpd = config.packages.wpd;
webshite = config.packages.webshite;
sal = inputs.sal.packages.${system}.default;
} }
); );
} }

View File

@ -63,6 +63,7 @@
}; };
}); });
webshite = inputs.webshite.packages.${system}.default; webshite = inputs.webshite.packages.${system}.default;
sal = inputs.sal.packages."x86_64-linux".default;
}; };
}; };
} }