diff options
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | flake.lock | 35 | ||||
| -rw-r--r-- | flake.nix | 272 | ||||
| -rw-r--r-- | flake/ci.nix | 72 | ||||
| -rw-r--r-- | flake/default.nix | 13 | ||||
| -rw-r--r-- | flake/dev-shell.nix | 42 | ||||
| -rw-r--r-- | lib/README.md | 5 | ||||
| -rw-r--r-- | lib/default.nix | 16 | ||||
| -rw-r--r-- | modules/README.md | 6 | ||||
| -rw-r--r-- | modules/darwin/default.nix | 18 | ||||
| -rw-r--r-- | modules/default.nix | 6 | ||||
| -rw-r--r-- | modules/flake/default.nix | 3 | ||||
| -rw-r--r-- | modules/flake/terranix.nix | 59 | ||||
| -rw-r--r-- | modules/nixos/default.nix | 22 | ||||
| -rw-r--r-- | modules/nixos/desktop/plasma/default.nix | 5 | ||||
| -rw-r--r-- | modules/nixos/profiles/server.nix | 5 | ||||
| -rw-r--r-- | modules/shared/traits/home-manager.nix | 3 | ||||
| -rw-r--r-- | openwrt/README.md | 5 | ||||
| -rw-r--r-- | openwrt/default.nix | 34 | ||||
| -rw-r--r-- | openwrt/turret.nix | 4 | ||||
| -rw-r--r-- | secrets/README.md | 14 | ||||
| -rw-r--r-- | systems/README.md | 21 | ||||
| -rw-r--r-- | systems/default.nix | 26 | ||||
| -rw-r--r-- | terranix/README.md | 21 | ||||
| -rw-r--r-- | terranix/default.nix | 23 | ||||
| -rw-r--r-- | users/README.md | 5 | ||||
| -rw-r--r-- | users/default.nix | 10 | ||||
| -rw-r--r-- | users/seth/programs/firefox/default.nix | 6 | ||||
| -rw-r--r-- | users/seth/programs/neovim.nix | 5 |
29 files changed, 389 insertions, 375 deletions
@@ -14,6 +14,10 @@ greasy taco i love </div> +## flake/ + +Pieces meant for maintaining this flake + ## lib/ Small functions I like to use around here @@ -46,10 +50,6 @@ Personal infrastructure defined with [terranix](https://terranix.org/) Home of my [home-manager](https://nix-community.github.io/home-manager/) user configurations -## .envrc - -My [nix-direnv](https://github.com/nix-community/nix-direnv) configuration - ## flake.nix Where everything begins @@ -123,16 +123,15 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "lanzaboote", "nixpkgs" ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1735774679, + "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", "type": "github" }, "original": { @@ -159,6 +158,26 @@ "type": "github" } }, + "getchpkgs": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735955308, + "narHash": "sha256-CMje7QJoU5SRQ2chXkM3nNCRORMMh1j+MTg/RPXm8Bs=", + "owner": "getchoo", + "repo": "nix-exprs", + "rev": "bd5a98434f7a394bbb95efcf74e17f15219c8fb9", + "type": "github" + }, + "original": { + "owner": "getchoo", + "repo": "nix-exprs", + "type": "github" + } + }, "getchvim": { "inputs": { "nix-filter": "nix-filter", @@ -224,7 +243,9 @@ "inputs": { "crane": "crane", "flake-compat": [], - "flake-parts": "flake-parts", + "flake-parts": [ + "flake-parts" + ], "nixpkgs": [ "nixpkgs" ], @@ -402,7 +423,6 @@ "openwrt-imagebuilder": { "inputs": { "flake-parts": [ - "lanzaboote", "flake-parts" ], "nixpkgs": [ @@ -434,6 +454,8 @@ "arkenfox": "arkenfox", "catppuccin": "catppuccin", "firefox-addons": "firefox-addons", + "flake-parts": "flake-parts", + "getchpkgs": "getchpkgs", "getchvim": "getchvim", "home-manager": "home-manager", "krunner-nix": "krunner-nix", @@ -511,7 +533,6 @@ "bats-assert": [], "bats-support": [], "flake-parts": [ - "lanzaboote", "flake-parts" ], "nixpkgs": [ @@ -7,18 +7,13 @@ }; outputs = - { - self, - nixpkgs, - nixpkgs-stable, - nix-darwin, - home-manager, - ... - }@inputs: + inputs: let - inherit (nixpkgs) lib; + flakeModules = import ./modules/flake; + in + inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" @@ -26,243 +21,32 @@ "aarch64-darwin" ]; - forAllSystems = lib.genAttrs systems; - nixpkgsFor = nixpkgs.legacyPackages; - - mkModule = type: name: file: { - _file = "${self.outPath}#${type}.${name}"; - imports = [ file ]; - }; - in - - { - apps = forAllSystems ( - system: - let - pkgs = nixpkgsFor.${system}; - - opentofu = pkgs.opentofu.withPlugins (plugins: [ - plugins.cloudflare - plugins.tailscale - ]); - - terranix = inputs.terranix.lib.terranixConfiguration { - inherit system; - modules = [ ./terranix ]; - }; - in - { - tf = { - type = "app"; - program = lib.getExe ( - pkgs.writeShellScriptBin "tf" '' - ln -sf ${terranix} config.tf.json - exec ${lib.getExe opentofu} "$@" - '' - ); - }; - } - ); - - checks = forAllSystems ( - system: - let - pkgs = nixpkgsFor.${system}; - - mkCheck = - { - name, - deps ? [ ], - script, - }: - pkgs.runCommand name { nativeBuildInputs = deps; } '' - ${script} - touch $out - ''; - in - { - actionlint = mkCheck { - name = "check-actionlint"; - deps = [ pkgs.actionlint ]; - script = "actionlint ${self}/.github/workflows/**"; - }; - - deadnix = mkCheck { - name = "check-deadnix"; - deps = [ pkgs.deadnix ]; - script = "deadnix --fail ${self}"; - }; - - just = mkCheck { - name = "check-just"; - deps = [ pkgs.just ]; - script = '' - cd ${self} - just --check --fmt --unstable - just --summary - ''; - }; - - nixfmt = mkCheck { - name = "check-nixfmt"; - deps = [ pkgs.nixfmt-rfc-style ]; - script = "nixfmt --check ${self}/**/*.nix"; - }; - - statix = mkCheck { - name = "check-statix"; - deps = [ pkgs.statix ]; - script = "statix check ${self}"; - }; - } - ); - - devShells = forAllSystems ( - system: - let - pkgs = nixpkgsFor.${system}; - in - { - default = pkgs.mkShellNoCC { - packages = - [ - # We want to make sure we have the same - # Nix behavior across machines - pkgs.nix - - # For CI - pkgs.actionlint - - # Nix tools - pkgs.nil - pkgs.statix - self.formatter.${system} - - pkgs.just - ] - ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ - # See above comment about Nix - inputs.nix-darwin.packages.${system}.darwin-rebuild - ] - ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ - - # Ditto - pkgs.nixos-rebuild - - inputs.agenix.packages.${system}.agenix - ]; - }; - } - ); - - lib = import ./lib { inherit lib; }; - - formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style); - - darwinModules = lib.mapAttrs (mkModule "darwin") { - default = ./modules/darwin; - }; - - nixosModules = lib.mapAttrs (mkModule "darwin") { - default = ./modules/nixos; - }; - - darwinConfigurations = lib.mapAttrs (lib.const nix-darwin.lib.darwinSystem) { - caroline = { - modules = [ ./systems/caroline ]; - specialArgs = { - inherit inputs; - }; - }; - }; - - homeConfigurations = lib.mapAttrs (lib.const home-manager.lib.homeManagerConfiguration) { - seth = { - modules = [ ./users/seth/home.nix ]; - pkgs = nixpkgsFor.x86_64-linux; - extraSpecialArgs = { - inherit inputs; - }; - }; - }; - - nixosConfigurations = - lib.mapAttrs (lib.const nixpkgs.lib.nixosSystem) { - glados = { - modules = [ ./systems/glados ]; - specialArgs = { - inherit inputs; - }; - }; - - glados-wsl = { - modules = [ ./systems/glados-wsl ]; - specialArgs = { - inherit inputs; - }; - }; - } - // { - atlas = nixpkgs-stable.lib.nixosSystem { - modules = [ ./systems/atlas ]; - specialArgs = { - inherit inputs; - }; - }; - }; - - legacyPackages.x86_64-linux = - let - pkgs = nixpkgsFor.x86_64-linux; - - openwrtTools = lib.makeScope pkgs.newScope (final: { - profileFromRelease = - release: (inputs.openwrt-imagebuilder.lib.profiles { inherit pkgs release; }).identifyProfile; - - buildOpenWrtImage = - { profile, ... }@args: - inputs.openwrt-imagebuilder.lib.build ( - final.profileFromRelease args.release profile - // builtins.removeAttrs args [ - "profile" - "release" - ] - ); - }); - in - { - turret = openwrtTools.callPackage ./openwrt/turret.nix { }; - }; - - hydraJobs = - let - # Architecture of "main" CI machine - ciSystem = "x86_64-linux"; - - derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage; - mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg); - - pkgs = nixpkgsFor.${ciSystem}; - in - { - # I don't care to run these for each system, as they should be the same - # and don't need to be cached - checks = self.checks.${ciSystem}; - devShells = self.devShells.${ciSystem}; + imports = [ + flakeModules.terranix + inputs.getchpkgs.flakeModules.configs + inputs.getchpkgs.flakeModules.checks + + ./flake + ./lib + ./modules + ./openwrt + ./systems + ./terranix + ./users + ]; - darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations; - homeConfigurations = mapCfgsToDerivs self.homeConfigurations; - nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations // { - # please add aarch64 runners github...please... - atlas = lib.deepSeq (derivFromCfg self.nixosConfigurations.atlas).drvPath pkgs.emptyFile; - }; - }; + flake = { inherit flakeModules; }; }; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; @@ -309,6 +93,11 @@ }; }; + getchpkgs = { + url = "github:getchoo/nix-exprs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + getchvim = { url = "github:getchoo/getchvim"; inputs.nixpkgs.follows = "nixpkgs"; @@ -328,6 +117,7 @@ url = "github:nix-community/lanzaboote"; inputs = { nixpkgs.follows = "nixpkgs"; + flake-parts.follows = "flake-parts"; flake-compat.follows = ""; pre-commit-hooks-nix.follows = ""; }; @@ -364,7 +154,7 @@ url = "github:astro/nix-openwrt-imagebuilder"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-parts.follows = "lanzaboote/flake-parts"; + flake-parts.follows = "flake-parts"; systems.follows = "nixos-wsl/flake-utils/systems"; }; }; @@ -378,7 +168,7 @@ url = "github:terranix/terranix"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-parts.follows = "lanzaboote/flake-parts"; + flake-parts.follows = "flake-parts"; systems.follows = "nixos-wsl/flake-utils/systems"; terranix-examples.follows = ""; bats-support.follows = ""; diff --git a/flake/ci.nix b/flake/ci.nix new file mode 100644 index 0000000..cd1857f --- /dev/null +++ b/flake/ci.nix @@ -0,0 +1,72 @@ +{ + lib, + withSystem, + self, + ... +}: + +{ + perSystem = + { pkgs, ... }: + { + quickChecks = { + actionlint = { + dependencies = [ pkgs.actionlint ]; + script = "actionlint ${self}/.github/workflows/**"; + }; + + deadnix = { + dependencies = [ pkgs.deadnix ]; + script = "deadnix --fail ${self}"; + }; + + just = { + dependencies = [ pkgs.just ]; + script = '' + cd ${self} + just --check --fmt --unstable + just --summary + ''; + }; + + nixfmt = { + dependencies = [ pkgs.nixfmt-rfc-style ]; + script = "nixfmt --check ${self}/**/*.nix"; + }; + + statix = { + dependencies = [ pkgs.statix ]; + script = "statix check ${self}"; + }; + }; + }; + + flake = { + hydraJobs = + + let + # Architecture of "main" CI machine + ciSystem = "x86_64-linux"; + + derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage; + mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg); + in + + withSystem ciSystem ( + { pkgs, self', ... }: + + { + # I don't care to run these for each system, as they should be the same + # and don't need to be cached + inherit (self') checks devShells; + + darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations; + homeConfigurations = mapCfgsToDerivs self.homeConfigurations; + nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations // { + # please add aarch64 runners github...please... + atlas = lib.deepSeq (derivFromCfg self.nixosConfigurations.atlas).drvPath pkgs.emptyFile; + }; + } + ); + }; +} diff --git a/flake/default.nix b/flake/default.nix new file mode 100644 index 0000000..ba160ff --- /dev/null +++ b/flake/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ./ci.nix + ./dev-shell.nix + ]; + + perSystem = + { pkgs, ... }: + + { + formatter = pkgs.nixfmt-rfc-style; + }; +} diff --git a/flake/dev-shell.nix b/flake/dev-shell.nix new file mode 100644 index 0000000..46e6ed0 --- /dev/null +++ b/flake/dev-shell.nix @@ -0,0 +1,42 @@ +{ + perSystem = + { + lib, + pkgs, + inputs', + self', + ... + }: + + { + devShells.default = pkgs.mkShellNoCC { + packages = + [ + # We want to make sure we have the same + # Nix behavior across machines + pkgs.nix + + # For CI + pkgs.actionlint + + # Nix tools + pkgs.nil + pkgs.statix + self'.formatter + + pkgs.just + ] + ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ + # See above comment about Nix + inputs'.nix-darwin.packages.darwin-rebuild + ] + ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + + # Ditto + pkgs.nixos-rebuild + + inputs'.agenix.packages.agenix + ]; + }; + }; +} diff --git a/lib/README.md b/lib/README.md deleted file mode 100644 index 97814c5..0000000 --- a/lib/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# ./lib/ - -## nginx.nix - -Small helpers to avoid boilerplate in the `services.nginx` module diff --git a/lib/default.nix b/lib/default.nix index 8279f8f..d7fb959 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,9 +1,11 @@ -{ lib }: +{ lib, ... }: -lib.makeExtensible ( - final: +{ + flake.lib = lib.makeExtensible ( + final: - lib.mapAttrs (lib.const (lib.flip import { inherit lib final; })) { - nginx = ./nginx.nix; - } -) + lib.mapAttrs (lib.const (lib.flip import { inherit lib final; })) { + nginx = ./nginx.nix; + } + ); +} diff --git a/modules/README.md b/modules/README.md deleted file mode 100644 index 7e45a1f..0000000 --- a/modules/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# ./modules/ - -These directory names are probably self explanatory - -In case they aren't: `darwin/` contains nix-darwin modules, `nixos/` contains -NixOS modules, and `shared` contains modules I use on both! diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 26ea30f..af7701e 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -1,9 +1,13 @@ { - imports = [ - ../shared - ./defaults - ./desktop - ./profiles - ./traits - ]; + flake.darwinModules = { + default = { + imports = [ + ../shared + ./defaults + ./desktop + ./profiles + ./traits + ]; + }; + }; } diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..e8a1832 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./darwin + ./nixos + ]; +} diff --git a/modules/flake/default.nix b/modules/flake/default.nix new file mode 100644 index 0000000..2cb7409 --- /dev/null +++ b/modules/flake/default.nix @@ -0,0 +1,3 @@ +{ + terranix = ./terranix.nix; +} diff --git a/modules/flake/terranix.nix b/modules/flake/terranix.nix new file mode 100644 index 0000000..cbf57b9 --- /dev/null +++ b/modules/flake/terranix.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + flake-parts-lib, + inputs, + ... +}: + +let + inherit (flake-parts-lib) mkSubmoduleOptions; + + namespace = "terranix"; + cfg = config.${namespace}; +in + +{ + options.terranix = mkSubmoduleOptions { + package = lib.mkOption { + type = lib.types.functionTo lib.types.package; + default = pkgs: pkgs.opentofu; + defaultText = lib.literalExpression "pkgs: pkgs.opentofu"; + apply = fn: fn pkgs; + description = "The Terraform-compatible implementation to use."; + example = lib.literalExpression "pkgs: pkgs.terraform"; + }; + + modules = lib.mkOption { + type = lib.types.listOf lib.types.deferredModule; + default = [ ]; + }; + }; + + config = { + perSystem = + { + lib, + pkgs, + system, + ... + }: + + let + terranixConfiguration = inputs.terranix.lib.terranixConfiguration { + inherit system; + inherit (cfg) modules; + }; + in + + { + apps.tf = { + program = pkgs.writeShellScriptBin "tf" '' + ln -sf ${terranixConfiguration} config.tf.json + exec ${lib.getExe cfg.package} "$@" + ''; + }; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 82e4b93..47a814d 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,11 +1,15 @@ { - imports = [ - ../shared - ./defaults - ./desktop - ./mixins - ./profiles - ./services - ./traits - ]; + flake.nixosModules = { + default = { + imports = [ + ../shared + ./defaults + ./desktop + ./mixins + ./profiles + ./services + ./traits + ]; + }; + }; } diff --git a/modules/nixos/desktop/plasma/default.nix b/modules/nixos/desktop/plasma/default.nix index dceded3..c021d46 100644 --- a/modules/nixos/desktop/plasma/default.nix +++ b/modules/nixos/desktop/plasma/default.nix @@ -2,11 +2,10 @@ config, lib, pkgs, - inputs, + inputs', ... }: let - inherit (pkgs.stdenv.hostPlatform) system; cfg = config.desktop.plasma; in { @@ -26,7 +25,7 @@ in systemPackages = [ pkgs.haruna # mpv frontend - inputs.krunner-nix.packages.${system}.default # thank you leah + inputs'.krunner-nix.packages.default # thank you leah ]; }; diff --git a/modules/nixos/profiles/server.nix b/modules/nixos/profiles/server.nix index e3e785b..a4eae44 100644 --- a/modules/nixos/profiles/server.nix +++ b/modules/nixos/profiles/server.nix @@ -1,8 +1,7 @@ { config, lib, - pkgs, - inputs, + inputs', ... }: let @@ -21,7 +20,7 @@ in lib.mkMerge [ { # All servers are most likely on stable, so we want to pull in some newer packages from time to time - _module.args.unstable = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + _module.args.unstable = inputs'.nixpkgs.legacyPackages; boot.tmp.cleanOnBoot = lib.mkDefault true; diff --git a/modules/shared/traits/home-manager.nix b/modules/shared/traits/home-manager.nix index f901cdc..01539a3 100644 --- a/modules/shared/traits/home-manager.nix +++ b/modules/shared/traits/home-manager.nix @@ -2,6 +2,7 @@ config, lib, inputs, + inputs', ... }: let @@ -17,7 +18,7 @@ in useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { - inherit inputs; + inherit inputs inputs'; }; }; }; diff --git a/openwrt/README.md b/openwrt/README.md deleted file mode 100644 index 5638da9..0000000 --- a/openwrt/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# ./openwrt/ - -## turret.nix - -My home router diff --git a/openwrt/default.nix b/openwrt/default.nix new file mode 100644 index 0000000..c8971a6 --- /dev/null +++ b/openwrt/default.nix @@ -0,0 +1,34 @@ +{ + lib, + withSystem, + inputs, + ... +}: + +{ + flake.legacyPackages.x86_64-linux = withSystem "x86_64-linux" ( + { pkgs, ... }: + + let + callPackage = lib.callPackageWith (pkgs // { inherit openwrtPackages; }); + openwrtPackages = { + profileFromRelease = + release: (inputs.openwrt-imagebuilder.lib.profiles { inherit pkgs release; }).identifyProfile; + + buildOpenWrtImage = + { profile, ... }@args: + inputs.openwrt-imagebuilder.lib.build ( + openwrtPackages.profileFromRelease args.release profile + // lib.removeAttrs args [ + "profile" + "release" + ] + ); + }; + in + + { + turret = callPackage ./turret.nix { }; + } + ); +} diff --git a/openwrt/turret.nix b/openwrt/turret.nix index 74587bf..ab4ff3e 100644 --- a/openwrt/turret.nix +++ b/openwrt/turret.nix @@ -1,9 +1,9 @@ { - buildOpenWrtImage, + openwrtPackages, runCommand, }: -buildOpenWrtImage { +openwrtPackages.buildOpenWrtImage { release = "23.05.0"; profile = "netgear_wac104"; diff --git a/secrets/README.md b/secrets/README.md deleted file mode 100644 index a7c75ad..0000000 --- a/secrets/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# ./secrets/ - -## */ - -Each directory is named after the system the secrets inside of it are meant for - -## secrets.nix - -agenix's -[secrets.nix](https://github.com/ryantm/agenix/blob/3a56735779db467538fb2e577eda28a9daacaca6/README.md#tutorial) - -## toSecrets.nix - -A function that helps structure the `secrets.nix` configuration diff --git a/systems/README.md b/systems/README.md deleted file mode 100644 index 8a3720d..0000000 --- a/systems/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# ./systems/ - -All of these names are based off the -[Portal](<https://en.wikipedia.org/wiki/Portal_(video_game)>) series - -## glados/ - -Main desktop - -## glados-wsl/ - -Main desktop, but the windows install :p - -## caroline/ - -2017 MacBook Air - -## atlas/ - -Ampere ARM server from Oracle, services my [Miniflux](https://miniflux.app/) -instance and some other things. diff --git a/systems/default.nix b/systems/default.nix new file mode 100644 index 0000000..51013f5 --- /dev/null +++ b/systems/default.nix @@ -0,0 +1,26 @@ +{ inputs, ... }: + +{ + configurations = { + nixos = { + glados = { + modules = [ ./glados ]; + }; + + glados-wsl = { + modules = [ ./glados-wsl ]; + }; + + atlas = { + modules = [ ./atlas ]; + nixpkgs = inputs.nixpkgs-stable; + }; + }; + + darwin = { + caroline = { + modules = [ ./caroline ]; + }; + }; + }; +} diff --git a/terranix/README.md b/terranix/README.md deleted file mode 100644 index dd2edd0..0000000 --- a/terranix/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# ./terranix/ - -## cloudflare/ - -DNS, Workers/Pages, Tunnels, etc through [Cloudflare](https://cloudflare.com/) - -## tailscale/ - -Secure, remote access via [tailscale](https://tailscale.com/) - -## cloud.nix - -[Cloud backend for OpenTofu state](https://opentofu.org/docs/language/settings/tf-cloud/) - -## vars.nix - -Shared variable definitions - -## versions.nix - -[Provider configuration](https://opentofu.org/docs/language/providers/configuration/) diff --git a/terranix/default.nix b/terranix/default.nix index d7c7778..3c95844 100644 --- a/terranix/default.nix +++ b/terranix/default.nix @@ -1,9 +1,18 @@ { - imports = [ - ./cloudflare - ./tailscale - ./cloud.nix - ./vars.nix - ./versions.nix - ]; + terranix = { + package = + pkgs: + pkgs.opentofu.withPlugins (plugins: [ + plugins.cloudflare + plugins.tailscale + ]); + + modules = [ + ./cloudflare + ./tailscale + ./cloud.nix + ./vars.nix + ./versions.nix + ]; + }; } diff --git a/users/README.md b/users/README.md deleted file mode 100644 index d1b1b5b..0000000 --- a/users/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# ./users/ - -## seth/ - -Me! (getchoo) diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..c48f1a8 --- /dev/null +++ b/users/default.nix @@ -0,0 +1,10 @@ +{ withSystem, ... }: + +{ + configurations.home = { + seth = { + modules = [ ./seth/home.nix ]; + pkgs = withSystem "x86_64-linux" ({ pkgs, ... }: pkgs); + }; + }; +} diff --git a/users/seth/programs/firefox/default.nix b/users/seth/programs/firefox/default.nix index a22ceb7..b378bc2 100644 --- a/users/seth/programs/firefox/default.nix +++ b/users/seth/programs/firefox/default.nix @@ -1,12 +1,10 @@ { config, lib, - pkgs, - inputs, + inputs', ... }: let - inherit (pkgs.stdenv.hostPlatform) system; cfg = config.seth.programs.firefox; in { @@ -27,7 +25,7 @@ in programs.firefox = { enable = true; profiles.arkenfox = { - extensions = with inputs.firefox-addons.packages.${system}; [ + extensions = with inputs'.firefox-addons.packages; [ bitwarden floccus ublock-origin diff --git a/users/seth/programs/neovim.nix b/users/seth/programs/neovim.nix index 5a5bf22..13f0d96 100644 --- a/users/seth/programs/neovim.nix +++ b/users/seth/programs/neovim.nix @@ -2,11 +2,10 @@ config, lib, pkgs, - inputs, + inputs', ... }: let - inherit (pkgs.stdenv.hostPlatform) system; cfg = config.seth.programs.neovim; in { @@ -21,7 +20,7 @@ in home.packages = [ ( let - getchvim = inputs.getchvim.packages.${system}.default; + getchvim = inputs'.getchvim.packages.default; in # remove desktop file pkgs.symlinkJoin { |
