diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-02-03 19:30:44 -0800 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:58:17 -0700 |
| commit | 5a0a36726756bc2a88770f8fd65418b6d3ce007b (patch) | |
| tree | c6eac6d1e52f6171d5dcb6b06b706329e3239618 | |
| parent | ffc499cddd42ff4bea818718ae0b2f12d0e5dfbb (diff) | |
migration: barebones c-pc config
| -rw-r--r-- | flake.lock | 93 | ||||
| -rw-r--r-- | flake.nix | 75 | ||||
| -rw-r--r-- | snowfall/modules/nixos/system/default.nix | 21 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/c-pc/default.nix | 17 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/c-pc/hardware.nix (renamed from hosts/c-pc/hardware.nix) | 0 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/c-pc/network.nix (renamed from hosts/c-pc/network.nix) | 3 |
6 files changed, 174 insertions, 35 deletions
@@ -16,6 +16,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -34,6 +50,43 @@ "type": "github" } }, + "flake-utils-plus": { + "inputs": { + "flake-utils": "flake-utils_2" + }, + "locked": { + "lastModified": 1715533576, + "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -126,7 +179,30 @@ "home-manager": "home-manager", "impermanence": "impermanence", "nix-minecraft": "nix-minecraft", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "snowfall-lib": "snowfall-lib" + } + }, + "snowfall-lib": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils-plus": "flake-utils-plus", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736130495, + "narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=", + "owner": "snowfallorg", + "repo": "lib", + "rev": "02d941739f98a09e81f3d2d9b3ab08918958beac", + "type": "github" + }, + "original": { + "owner": "snowfallorg", + "repo": "lib", + "type": "github" } }, "systems": { @@ -143,6 +219,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", @@ -1,6 +1,6 @@ { description = "Nixos config flake"; - + inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -18,38 +18,51 @@ nix-minecraft.url = "github:CartConnoisseur/nix-minecraft"; }; - outputs = {nixpkgs, ...} @inputs: { - nixosConfigurations = { - c-pc = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/c-pc/configuration.nix - inputs.home-manager.nixosModules.default - inputs.impermanence.nixosModules.impermanence - inputs.nix-minecraft.nixosModules.minecraft-servers - (import ./overlays) - ]; - }; + outputs = inputs: + inputs.snowfall-lib.mkFlake { + inherit inputs; + src = ./.; - copenhagen = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/copenhagen/configuration.nix - inputs.home-manager.nixosModules.default - inputs.impermanence.nixosModules.impermanence - inputs.nix-minecraft.nixosModules.minecraft-servers - ]; - }; + snowfall = { + root = ./snowfall; + namespace = "cxl"; - phoenix = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./hosts/phoenix/configuration.nix - inputs.home-manager.nixosModules.default - inputs.impermanence.nixosModules.impermanence - inputs.nix-minecraft.nixosModules.minecraft-servers - ]; + meta = { + name = "cxl"; + title = "cxl flake"; + }; }; }; - }; + # nixosConfigurations = { + # c-pc = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # modules = [ + # ./hosts/c-pc/configuration.nix + # inputs.home-manager.nixosModules.default + # inputs.impermanence.nixosModules.impermanence + # inputs.nix-minecraft.nixosModules.minecraft-servers + # (import ./overlays) + # ]; + # }; + + # copenhagen = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # modules = [ + # ./hosts/copenhagen/configuration.nix + # inputs.home-manager.nixosModules.default + # inputs.impermanence.nixosModules.impermanence + # inputs.nix-minecraft.nixosModules.minecraft-servers + # ]; + # }; + + # phoenix = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # modules = [ + # ./hosts/phoenix/configuration.nix + # inputs.home-manager.nixosModules.default + # inputs.impermanence.nixosModules.impermanence + # inputs.nix-minecraft.nixosModules.minecraft-servers + # ]; + # }; + } diff --git a/snowfall/modules/nixos/system/default.nix b/snowfall/modules/nixos/system/default.nix new file mode 100644 index 0000000..a6a570b --- /dev/null +++ b/snowfall/modules/nixos/system/default.nix @@ -0,0 +1,21 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.system; +in { + options.${namespace}.system = with types; { + hostname = mkOption { + type = strMatching "^$|^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$"; + }; + + id = mkOption { + default = null; + type = nullOr str; + }; + }; + + config = { + networking.hostName = cfg.hostname; + networking.hostId = cfg.id; + }; +}
\ No newline at end of file diff --git a/snowfall/systems/x86_64-linux/c-pc/default.nix b/snowfall/systems/x86_64-linux/c-pc/default.nix new file mode 100644 index 0000000..ad4b923 --- /dev/null +++ b/snowfall/systems/x86_64-linux/c-pc/default.nix @@ -0,0 +1,17 @@ +{ lib, namespace, ... }: + +with lib; with lib.${namespace}; { + imports = [ + ./hardware.nix + ./network.nix + ]; + + cxl = { + system = { + hostname = "c-pc"; + id = "23ce94ff"; + }; + }; + + system.stateVersion = "23.11"; +}
\ No newline at end of file diff --git a/hosts/c-pc/hardware.nix b/snowfall/systems/x86_64-linux/c-pc/hardware.nix index 68cf8bd..68cf8bd 100644 --- a/hosts/c-pc/hardware.nix +++ b/snowfall/systems/x86_64-linux/c-pc/hardware.nix diff --git a/hosts/c-pc/network.nix b/snowfall/systems/x86_64-linux/c-pc/network.nix index 969b49f..aa7e075 100644 --- a/hosts/c-pc/network.nix +++ b/snowfall/systems/x86_64-linux/c-pc/network.nix @@ -2,9 +2,6 @@ { networking = { - hostName = "c-pc"; - hostId = "23ce94ff"; - useDHCP = true; wireless = { |