steveej-x13s-rmvbl: boring setup with copying the whole x13s flake

This commit is contained in:
steveej 2024-01-28 21:18:08 +01:00
parent 4663780877
commit 6fb71cbf4f
7 changed files with 281 additions and 67 deletions

View file

@ -3,7 +3,7 @@
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# requires for home-manager modules
# required for home-manager modules
nixpkgs-unstable-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
nixpkgs-2211.url = "github:nixos/nixpkgs/nixos-22.11";
@ -18,6 +18,9 @@
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-x13s.url = "git+https://codeberg.org/steveej/nixos-x13s";
nixos-x13s.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
@ -27,51 +30,60 @@
, ...
}:
let
targetPlatform = "aarch64-linux";
system = "aarch64-linux";
buildPlatform = "x86_64-linux";
nodeName = "steveej-x13s-rmvbl";
x13s-flake = get-flake ../steveej-x13s;
mkNixosConfiguration = { extraModules ? [ ], ... } @ attrs:
nixpkgs.lib.nixosSystem (
nixpkgs.lib.attrsets.recursiveUpdate
attrs
{
specialArgs = (import ./default.nix {
system = targetPlatform;
inherit nodeName;
repoFlake = get-flake ../../../..;
# TODO: double-check if this hack doesn't have negative side-effects
# the reason for it is so that `nodeFlake.inputs.nixos-x13s.nixosModules.default` in the module is found
nodeFlake = x13s-flake;
}).meta.nodeSpecialArgs.${nodeName};
modules =
[
../steveej-x13s/configuration.nix
./configuration.nix
]
++ extraModules;
}
);
repoFlake = get-flake ../../../..;
in
{
nixosConfigurations = {
native = mkNixosConfiguration {
system = targetPlatform;
};
lib = {
mkNixosConfiguration = { nodeName, extraModules ? [ ], ... } @ attrs:
nixpkgs.lib.nixosSystem (
nixpkgs.lib.attrsets.recursiveUpdate
attrs
{
specialArgs = (import ./default.nix {
inherit system;
inherit nodeName repoFlake;
cross = mkNixosConfiguration {
extraModules = [
{
nixpkgs.buildPlatform.system = buildPlatform;
nixpkgs.hostPlatform.system = targetPlatform;
}
];
};
nodeFlake = self;
}).meta.nodeSpecialArgs.${nodeName};
modules =
[
# repoFlake.nixosModules.hardware-x13s
]
++ extraModules;
}
);
};
nixosConfigurations =
let
nodeName = "steveej-x13s-rmvbl";
in
{
native = self.lib.mkNixosConfiguration {
inherit system nodeName;
extraModules = [
./configuration.nix
{
users.commonUsers.installPassword = "install";
}
];
};
cross = self.lib.mkNixosConfiguration {
inherit nodeName;
extraModules = [
./configuration.nix
{
nixpkgs.buildPlatform.system = buildPlatform;
nixpkgs.hostPlatform.system = system;
}
];
};
};
};
}