Compare commits

..

2 commits

Author SHA1 Message Date
Geoffrey Frogeye bdabf30728
Add repl 2024-05-08 09:47:57 +02:00
Geoffrey Frogeye 176be4f218
Shorten flake a bit 2024-05-08 09:37:04 +02:00
4 changed files with 88 additions and 60 deletions

View file

@ -220,6 +220,24 @@
"inputs": { "inputs": {
"systems": "systems_2" "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": { "locked": {
"lastModified": 1701680307, "lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
@ -234,9 +252,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": { "flake-utils_4": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1685518550, "lastModified": 1685518550,
@ -365,7 +383,7 @@
}, },
"lix-module": { "lix-module": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"flakey-profile": "flakey-profile", "flakey-profile": "flakey-profile",
"lix": [ "lix": [
"lix" "lix"
@ -501,7 +519,7 @@
}, },
"nixvim": { "nixvim": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -588,7 +606,7 @@
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_4",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@ -613,6 +631,7 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"lix": "lix", "lix": "lix",
"lix-module": "lix-module", "lix-module": "lix-module",
@ -702,6 +721,21 @@
"type": "github" "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": { "unixpkgs": {
"locked": { "locked": {
"lastModified": 1714280680, "lastModified": 1714280680,

View file

@ -45,9 +45,12 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nur.url = "github:nix-community/NUR"; 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 let
nixpkgsConfig = { nixpkgsConfig = {
config = { config = {
@ -90,73 +93,62 @@
} }
]; ];
}; };
flakeTools = { self }: flake-utils.lib.eachDefaultSystem (system:
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";
};
repl = {
type = "app";
program = "${pkgs.writeShellScript "vivarium-repl" ''
${pkgs.nix}/bin/nix repl --expr 'let flake = builtins.getFlake "${self}"; in flake // flake.nixosConfigurations // rec { pkgs = flake.inputs.nixpkgs.legacyPackages.${system}; lib = pkgs.lib; }'
''}";
};
};
}
);
}; };
in 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 # Reusable configurations
lib = lib; inherit lib;
nixosModules.dotfiles = { nixosModules.dotfiles.imports = [ ./os ];
imports = [ nixOnDroidModules.dotfiles.imports = [ ./nod ];
./os homeManagerModules.dotfiles.imports = [ ./hm ];
disko.nixosModules.disko
];
};
nixOnDroidModules.dotfiles = {
imports = [
./nod
# home-manager is included
];
};
homeManagerModules.dotfiles = {
imports = [
./hm
stylix.homeManagerModules.stylix
];
};
# Actual configurations # Actual configurations
nixosConfigurations.curacao = lib.nixosSystem { nixosConfigurations.curacao = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [ ./curacao ];
./curacao
];
}; };
nixosConfigurations.curacao-usb = lib.nixosSystem { nixosConfigurations.curacao-usb = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [ ./curacao/usb.nix ];
./curacao/usb.nix
];
}; };
nixosConfigurations.pindakaas = lib.nixosSystem { nixosConfigurations.pindakaas = lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [ ./pindakaas ];
./pindakaas
];
}; };
nixosConfigurations.pindakaas-sd = lib.nixosSystem { nixosConfigurations.pindakaas-sd = lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [ ./pindakaas/sd.nix ];
./pindakaas/sd.nix
];
}; };
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { }; nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };
}; } // (lib.flakeTools { inherit self; });
} }

View file

@ -1,4 +1,4 @@
{ ... }: { stylix, ... }:
{ {
imports = [ imports = [
../common/frogarized ../common/frogarized
@ -21,6 +21,7 @@
./rebuild ./rebuild
./shell ./shell
./ssh.nix ./ssh.nix
stylix.homeManagerModules.stylix
./theme ./theme
./tmux ./tmux
./vim ./vim

View file

@ -1,4 +1,4 @@
{ ... }: { disko, ... }:
{ {
imports = [ imports = [
../options.nix ../options.nix
@ -10,6 +10,7 @@
./desktop.nix ./desktop.nix
./dev ./dev
./diff ./diff
disko.nixosModules.disko
./gaming ./gaming
./geoffrey.nix ./geoffrey.nix
# ./lix # ./lix