From 176be4f218c28b4b75f4eb3a404c304b19578618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 8 May 2024 09:37:04 +0200 Subject: [PATCH] Shorten flake a bit --- flake.lock | 44 +++++++++++++++++++++--- flake.nix | 90 +++++++++++++++++++++----------------------------- hm/default.nix | 3 +- os/default.nix | 3 +- 4 files changed, 81 insertions(+), 59 deletions(-) diff --git a/flake.lock b/flake.lock index 0a09faf..d07baff 100644 --- a/flake.lock +++ b/flake.lock @@ -220,6 +220,24 @@ "inputs": { "systems": "systems_2" }, + "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_3": { + "inputs": { + "systems": "systems_3" + }, "locked": { "lastModified": 1701680307, "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", @@ -234,9 +252,9 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1685518550, @@ -365,7 +383,7 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "flakey-profile": "flakey-profile", "lix": [ "lix" @@ -501,7 +519,7 @@ }, "nixvim": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ], @@ -588,7 +606,7 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "gitignore": "gitignore", "nixpkgs": [ "nixvim", @@ -613,6 +631,7 @@ "root": { "inputs": { "disko": "disko", + "flake-utils": "flake-utils", "home-manager": "home-manager", "lix": "lix", "lix-module": "lix-module", @@ -702,6 +721,21 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "unixpkgs": { "locked": { "lastModified": 1714280680, diff --git a/flake.nix b/flake.nix index 04502ea..dcae282 100644 --- a/flake.nix +++ b/flake.nix @@ -45,9 +45,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/NUR"; + # Local + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, unixpkgs, disko, nix-on-droid, stylix, ... }@attrs: + outputs = { self, nixpkgs, unixpkgs, disko, nix-on-droid, flake-utils, ... }@attrs: + # Machine independant outputs let nixpkgsConfig = { config = { @@ -93,70 +96,53 @@ }; in { - # Easily expose apps to scripts - apps = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: { - disko = { - type = "app"; - program = "${disko.packages.${system}.default}/bin/disko"; - }; - nixos-generate-config = { - type = "app"; - program = "${nixpkgs.legacyPackages.${system}.nixos-install-tools}/bin/nixos-generate-config"; - }; - nixos-install = { - type = "app"; - program = "${nixpkgs.legacyPackages.${system}.nixos-install-tools}/bin/nixos-install"; - }; - nixos-rebuild = { - type = "app"; - program = "${nixpkgs.legacyPackages.${system}.nixos-rebuild}/bin/nixos-rebuild"; - }; - }); # Reusable configurations - lib = lib; - nixosModules.dotfiles = { - imports = [ - ./os - disko.nixosModules.disko - ]; - }; - nixOnDroidModules.dotfiles = { - imports = [ - ./nod - # home-manager is included - ]; - }; - homeManagerModules.dotfiles = { - imports = [ - ./hm - stylix.homeManagerModules.stylix - ]; - }; + inherit lib; + nixosModules.dotfiles.imports = [ ./os ]; + nixOnDroidModules.dotfiles.imports = [ ./nod ]; + homeManagerModules.dotfiles.imports = [ ./hm ]; # Actual configurations nixosConfigurations.curacao = lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./curacao - ]; + modules = [ ./curacao ]; }; nixosConfigurations.curacao-usb = lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./curacao/usb.nix - ]; + modules = [ ./curacao/usb.nix ]; }; nixosConfigurations.pindakaas = lib.nixosSystem { system = "aarch64-linux"; - modules = [ - ./pindakaas - ]; + modules = [ ./pindakaas ]; }; nixosConfigurations.pindakaas-sd = lib.nixosSystem { system = "aarch64-linux"; - modules = [ - ./pindakaas/sd.nix - ]; + modules = [ ./pindakaas/sd.nix ]; }; nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { }; - }; + } // (flake-utils.lib.eachDefaultSystem (system: + # Machine dependant outputs + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + apps = { + disko = { + type = "app"; + program = "${disko.packages.${system}.default}/bin/disko"; + }; + nixos-generate-config = { + type = "app"; + program = "${pkgs.nixos-install-tools}/bin/nixos-generate-config"; + }; + nixos-install = { + type = "app"; + program = "${pkgs.nixos-install-tools}/bin/nixos-install"; + }; + nixos-rebuild = { + type = "app"; + program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild"; + }; + }; + } + )); } diff --git a/hm/default.nix b/hm/default.nix index 63e76a4..ed7bfce 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ stylix, ... }: { imports = [ ../common/frogarized @@ -21,6 +21,7 @@ ./rebuild ./shell ./ssh.nix + stylix.homeManagerModules.stylix ./theme ./tmux ./vim diff --git a/os/default.nix b/os/default.nix index 0c2c71c..f7be3ce 100644 --- a/os/default.nix +++ b/os/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ disko, ... }: { imports = [ ../options.nix @@ -10,6 +10,7 @@ ./desktop.nix ./dev ./diff + disko.nixosModules.disko ./gaming ./geoffrey.nix # ./lix