summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2026-01-12 17:30:18 +0100
committerMathias Magnusson <mathias@magnusson.space>2026-01-12 17:30:18 +0100
commitfd7724dbd0c21449d5286e272a5d5020e1fc4372 (patch)
treeeb0c6609bc4a0b79a55bcf78a04328226c158415
parentf773ef72fd95e6e3424ac7f822dcc488d34f5fb9 (diff)
downloadoden-fd7724dbd0c21449d5286e272a5d5020e1fc4372.tar.gz
move some stuff out of flake.nix
-rw-r--r--configuration.nix7
-rw-r--r--disko.nix3
-rw-r--r--flake.nix22
-rw-r--r--impermanence.nix4
4 files changed, 17 insertions, 19 deletions
diff --git a/configuration.nix b/configuration.nix
index 7917283..93fa862 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -13,8 +13,15 @@
./immich.nix
./postgresql.nix
./minecraft.nix
+
+ inputs.agenix.nixosModules.default
];
+ nixpkgs = {
+ config.allowUnfree = true;
+ overlays = [ inputs.agenix.overlays.default ];
+ };
+
powerManagement.powertop.enable = true;
hardware.graphics.extraPackages = with pkgs; [
diff --git a/disko.nix b/disko.nix
index 469019e..dc0bd2c 100644
--- a/disko.nix
+++ b/disko.nix
@@ -1,4 +1,7 @@
+{ config, inputs, ... }:
{
+ imports = [ inputs.disko.nixosModules.disko ];
+
disko.devices = {
disk = {
main = {
diff --git a/flake.nix b/flake.nix
index 98aac21..5ccb5d4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,48 +17,34 @@
self,
nixpkgs,
unstable,
- disko,
- impermanence,
- agenix,
...
}:
let
- pkgsFor = system: import nixpkgs {
- inherit system;
- config.allowUnfree = true;
- overlays = [
- agenix.overlays.default
- ];
- };
forAllSystems =
f:
nixpkgs.lib.genAttrs
[ "x86_64-linux" "aarch64-linux" ]
- (system: f (pkgsFor system));
+ (system: f { inherit system; pkgs = import nixpkgs { inherit system; }; });
in
{
nixosConfigurations.oden = nixpkgs.lib.nixosSystem {
- pkgs = pkgsFor "x86_64-linux";
modules = [
./configuration.nix
- disko.nixosModules.disko
- impermanence.nixosModules.impermanence
- agenix.nixosModules.default
];
specialArgs = {
inherit inputs;
};
};
- packages = forAllSystems (pkgs: {
+ packages = forAllSystems ({ system, pkgs }: {
deploy = pkgs.writeShellScriptBin "deploy" ''
[ -n "$1" ] && action="$1" || action="switch"
nixos-rebuild --flake .#oden "$action" --target-host oden --build-host oden --use-remote-sudo
'';
});
- devShells = forAllSystems (pkgs: {
+ devShells = forAllSystems ({ system, pkgs }: {
default = pkgs.mkShellNoCC {
packages = [
- pkgs.agenix
+ inputs.agenix.packages.${system}.agenix
self.packages.${pkgs.system}.deploy
];
};
diff --git a/impermanence.nix b/impermanence.nix
index ae62f3c..d4f23ee 100644
--- a/impermanence.nix
+++ b/impermanence.nix
@@ -1,11 +1,13 @@
# sudo mount --ro /dev/nvme0n1p2 ./mnt --mkdir
# ls mnt/old_roots
-{ lib, config, options, ... }:
+{ lib, config, options, inputs, ... }:
let
cfg = config.oden.persist;
in
{
+ imports = [ inputs.impermanence.nixosModules.impermanence ];
+
options.oden.persist =
with lib;
with types;