refactor(system): flatten

This commit is contained in:
ooks-io 2024-05-24 17:50:32 +12:00
parent 8298fc375a
commit 33cbd9dfc7
12 changed files with 72 additions and 309 deletions

257
flake.lock generated
View file

@ -103,21 +103,6 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"flake-compat": {
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -159,28 +144,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-root": { "flake-root": {
"locked": { "locked": {
"lastModified": 1713493429, "lastModified": 1713493429,
@ -267,25 +230,7 @@
}, },
"flake-utils_5": { "flake-utils_5": {
"inputs": { "inputs": {
"systems": "systems_11" "systems": "systems_13"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_14"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -607,7 +552,7 @@
"xdg-portal-hyprland", "xdg-portal-hyprland",
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_12" "systems": "systems_11"
}, },
"locked": { "locked": {
"lastModified": 1713121246, "lastModified": 1713121246,
@ -688,25 +633,6 @@
"type": "github" "type": "github"
} }
}, },
"lib-aggregate": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1716120557,
"narHash": "sha256-rvNq9YolMY1DRMgwdAti8qwNDjkhTsotSWa15/Ch7+A=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "5fa64b174daa22fe0d20ebbcc0ec2c7905b503f1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "lib-aggregate",
"type": "github"
}
},
"nh": { "nh": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -768,27 +694,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-eval-jobs": {
"inputs": {
"flake-parts": "flake-parts_3",
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs_9",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1715804156,
"narHash": "sha256-GtIHP86Cz1kD9xZO/cKbNQACHKdoT9WFbLJAq6W2EDY=",
"owner": "nix-community",
"repo": "nix-eval-jobs",
"rev": "bb95091f6c6f38f6cfc215a1797a2dd466312c8b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-eval-jobs",
"type": "github"
}
},
"nix-formatter-pack": { "nix-formatter-pack": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -812,28 +717,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-on-droid": { "nix-on-droid": {
"inputs": { "inputs": {
"home-manager": [ "home-manager": [
@ -948,21 +831,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1716079763,
"narHash": "sha256-DGRfb7fO7c3XDS3twmuaV5NAGPPdU3W7Q35fjIZc8iY=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0df131b5ee4d928a4b664b6d0cd99cf134d6ab6b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-small": { "nixpkgs-small": {
"locked": { "locked": {
"lastModified": 1716323205, "lastModified": 1716323205,
@ -979,60 +847,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-wayland": {
"inputs": {
"flake-compat": "flake-compat",
"lib-aggregate": "lib-aggregate",
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1716366111,
"narHash": "sha256-1i1YJjeGBiIzBjZir1pQBwueHjRkpcPEsSrNbiyqMg4=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "088d7d9e7278f38cd9d01a4099e47fad5b1da66d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"type": "github"
}
},
"nixpkgs_10": { "nixpkgs_10": {
"locked": {
"lastModified": 1716293225,
"narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1710451336,
"narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d691274a972b3165335d261cc4671335f5c67de9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_12": {
"locked": { "locked": {
"lastModified": 1712963716, "lastModified": 1712963716,
"narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=",
@ -1048,7 +863,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_13": { "nixpkgs_11": {
"locked": { "locked": {
"lastModified": 1716097317, "lastModified": 1716097317,
"narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=", "narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=",
@ -1178,16 +993,16 @@
}, },
"nixpkgs_9": { "nixpkgs_9": {
"locked": { "locked": {
"lastModified": 1715037484, "lastModified": 1710451336,
"narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=", "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ad7efee13e0d216bf29992311536fce1d3eefbef", "rev": "d691274a972b3165335d261cc4671335f5c67de9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -1248,7 +1063,7 @@
}, },
"ooks-scripts": { "ooks-scripts": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_11" "nixpkgs": "nixpkgs_9"
}, },
"locked": { "locked": {
"lastModified": 1712473070, "lastModified": 1712473070,
@ -1283,7 +1098,6 @@
"nixarr": "nixarr", "nixarr": "nixarr",
"nixpkgs": "nixpkgs_8", "nixpkgs": "nixpkgs_8",
"nixpkgs-small": "nixpkgs-small", "nixpkgs-small": "nixpkgs-small",
"nixpkgs-wayland": "nixpkgs-wayland",
"ooks-scripts": "ooks-scripts", "ooks-scripts": "ooks-scripts",
"xdg-portal-hyprland": "xdg-portal-hyprland", "xdg-portal-hyprland": "xdg-portal-hyprland",
"zjstatus": "zjstatus" "zjstatus": "zjstatus"
@ -1412,16 +1226,16 @@
}, },
"systems_11": { "systems_11": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1689347949,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"type": "github" "type": "github"
} }
}, },
@ -1441,21 +1255,6 @@
} }
}, },
"systems_13": { "systems_13": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_14": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -1611,28 +1410,6 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nixpkgs-wayland",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1711963903,
"narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"vpnconfinement": { "vpnconfinement": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -1658,8 +1435,8 @@
"inputs": { "inputs": {
"hyprland-protocols": "hyprland-protocols_2", "hyprland-protocols": "hyprland-protocols_2",
"hyprlang": "hyprlang_5", "hyprlang": "hyprlang_5",
"nixpkgs": "nixpkgs_12", "nixpkgs": "nixpkgs_10",
"systems": "systems_13" "systems": "systems_12"
}, },
"locked": { "locked": {
"lastModified": 1716290197, "lastModified": 1716290197,
@ -1708,8 +1485,8 @@
"zjstatus": { "zjstatus": {
"inputs": { "inputs": {
"crane": "crane_2", "crane": "crane_2",
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_13", "nixpkgs": "nixpkgs_11",
"rust-overlay": "rust-overlay_3" "rust-overlay": "rust-overlay_3"
}, },
"locked": { "locked": {

View file

@ -6,7 +6,7 @@ in
{ {
imports = [ imports = [
./systemd ./systemd.nix
# ./grub # ./grub
]; ];

View file

@ -2,7 +2,7 @@
let let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.systemModules.plymouth; cfg = config.systemModules.boot.plymouth;
in in
{ {

View file

@ -2,14 +2,13 @@
{ {
imports = [ imports = [
./gaming
./shell ./shell
./bootloader ./boot
./nix ./nix
./programs ./programs
./displayManager ./displayManager
./networking ./networking
./locale ./locale.nix
./virtualization ./virtualization
./security ./security
./services ./services

View file

@ -1,5 +1,5 @@
{ {
imports = [ imports = [
./tuigreet ./tuigreet.nix
]; ];
} }

View file

@ -1,30 +0,0 @@
{ pkgs, lib, config, ... }:
let
inherit (lib) mkIf;
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
host = config.systemModules.host;
in
{
config = mkIf (host.type != "phone") {
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${tuigreet} --time --remember --cmd Hyprland"; # TODO: dont hardcode this
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
};
}

View file

@ -1,17 +0,0 @@
{ lib, ... }:
let
inherit (lib) mkDefault;
in
{
i18n = {
defaultLocale = mkDefault "en_US.UTF-8";
supportedLocales = mkDefault [
"en_US.UTF-8/UTF-8"
];
};
time.timeZone = mkDefault "Pacific/Auckland";
location.provider = "geoclue2";
services.geoclue2.enable = true;
}

View file

@ -7,12 +7,12 @@ in
{ {
imports = [ imports = [
./firewall ./firewall.nix
./tools ./tools.nix
./ssh ./ssh.nix
./tcp ./tcp.nix
./resolved ./resolved.nix
./tailscale ./tailscale.nix
]; ];
config = mkIf (host.type != "phone") { config = mkIf (host.type != "phone") {

View file

@ -1,10 +1,49 @@
{ lib, ... }: { lib, config, pkgs, inputs, ... }:
let
inherit (lib) mkIf mapAttrs mapAttrsToList;
host = config.systemModules.host;
in
{ {
imports = [ imports = [
./nh ./nh.nix
./nix ./nixpkgs.nix
./nixpkgs ./subs.nix
./subs
]; ];
config = mkIf (host.type != "phone") {
environment = {
systemPackages = with pkgs; [
git
deadnix
statix
];
defaultPackages = [];
etc = {
"nix/flake-channels/nixpkgs".source = inputs.nixpkgs;
"nix/flake-channels/home-manager".source = inputs.nixpkgs;
};
};
nix = {
registry = mapAttrs (_: v: {flake = v;}) inputs;
nixPath = mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
optimise = {
automatic = true;
dates = [ "18:00" ];
};
gc = {
automatic = true;
dates = "Sun *-*-* 17:00";
options = "--delete-older-than 30d";
};
settings = {
flake-registry = "etc/nix/registry.json";
allowed-users = [ "root" "@wheel" ];
trusted-users = [ "root" "@wheel" ];
experimental-features = [ "nix-command" "flakes" ];
builders-use-substitutes = true;
};
};
};
} }

View file

@ -13,10 +13,6 @@ in
programs.nh = { programs.nh = {
enable = true; enable = true;
package = pkgs.nh; package = pkgs.nh;
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
}; };
}; };
} }

View file

@ -17,7 +17,6 @@ in
}; };
overlays = [ overlays = [
(final: prev: { (final: prev: {
waybar = inputs.nixpkgs-wayland.packages.${prev.system}.waybar;
zjstatus = inputs.zjstatus.packages.${prev.system}.default; zjstatus = inputs.zjstatus.packages.${prev.system}.default;
}) })
]; ];