1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 19:11:08 +01:00

feat: replace nixinate by nixos-rebuild

This commit is contained in:
2023-12-28 11:46:45 +01:00
parent 263e13c8f8
commit 77d75b4d8b
2 changed files with 23 additions and 88 deletions

21
flake.lock generated
View File

@@ -731,26 +731,6 @@
"type": "github" "type": "github"
} }
}, },
"nixinate_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1688141737,
"narHash": "sha256-qHrNMYWukOKmKVf6wXOGKj1xxUnOGjvTRbt/PLLXuBE=",
"owner": "matthewcroughan",
"repo": "nixinate",
"rev": "7902ae845e6cc5bd450e510cdf5e009a6e4a44d9",
"type": "github"
},
"original": {
"owner": "matthewcroughan",
"repo": "nixinate",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1693636127, "lastModified": 1693636127,
@@ -1186,7 +1166,6 @@
"menstruation-backend": "menstruation-backend_2", "menstruation-backend": "menstruation-backend_2",
"menstruation-telegram": "menstruation-telegram_2", "menstruation-telegram": "menstruation-telegram_2",
"nix-on-droid": "nix-on-droid_2", "nix-on-droid": "nix-on-droid_2",
"nixinate": "nixinate_2",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_6",
"nixpkgs-old": "nixpkgs-old_2", "nixpkgs-old": "nixpkgs-old_2",
"nixpkgs-unstable": "nixpkgs-unstable_2", "nixpkgs-unstable": "nixpkgs-unstable_2",

View File

@@ -9,7 +9,6 @@
menstruation-backend.url = "github:kmein/menstruation.rs"; menstruation-backend.url = "github:kmein/menstruation.rs";
menstruation-telegram.url = "github:kmein/menstruation-telegram"; menstruation-telegram.url = "github:kmein/menstruation-telegram";
nix-on-droid.url = "github:t184256/nix-on-droid/release-23.05"; nix-on-droid.url = "github:t184256/nix-on-droid/release-23.05";
nixinate.url = "github:matthewcroughan/nixinate";
nixpkgs-old.url = "github:NixOS/nixpkgs/50fc86b75d2744e1ab3837ef74b53f103a9b55a0"; nixpkgs-old.url = "github:NixOS/nixpkgs/50fc86b75d2744e1ab3837ef74b53f103a9b55a0";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/master"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
@@ -37,7 +36,6 @@
menstruation-telegram.inputs.nixpkgs.follows = "nixpkgs-old"; menstruation-telegram.inputs.nixpkgs.follows = "nixpkgs-old";
nix-on-droid.inputs.home-manager.follows = "home-manager"; nix-on-droid.inputs.home-manager.follows = "home-manager";
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs"; nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
nixinate.inputs.nixpkgs.follows = "nixpkgs";
recht.inputs.flake-utils.follows = "flake-utils"; recht.inputs.flake-utils.follows = "flake-utils";
recht.inputs.nixpkgs.follows = "nixpkgs"; recht.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.inputs.flake-utils.follows = "flake-utils"; rust-overlay.inputs.flake-utils.follows = "flake-utils";
@@ -61,7 +59,6 @@
nixpkgs-unstable, nixpkgs-unstable,
nur, nur,
home-manager, home-manager,
nixinate,
agenix, agenix,
retiolum, retiolum,
flake-utils, flake-utils,
@@ -70,32 +67,36 @@
... ...
}: }:
{ {
apps = apps = {
nixinate.nixinate.x86_64-linux self x86_64-linux = let
// { pkgs = nixpkgs.legacyPackages.x86_64-linux;
x86_64-linux = let lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.x86_64-linux; in
in { {
mock-secrets = { mock-secrets = {
type = "app"; type = "app";
program = toString (pkgs.writers.writeDash "mock-secrets" '' program = toString (pkgs.writers.writeDash "mock-secrets" ''
${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt ${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt
''); '');
}; };
deploy = { }
type = "app"; // builtins.listToAttrs (map (hostname: let
program = toString (pkgs.writers.writeDash "deploy" '' externalNetwork = import ./lib/external-network.nix;
if [ $# -eq 0 ] targets = {
then ful = "root@ful";
systems='${toString (builtins.attrNames self.nixosConfigurations)}' zaatar = "root@zaatar";
else makanek = "root@makanek";
systems=$* manakish = "root@manakish";
fi kabsa = "root@kabsa";
${pkgs.parallel}/bin/parallel --line-buffer --tagstring '{}' 'nix run .\?submodules=1\#apps.nixinate.{}' ::: $systems
'');
}; };
}; in
}; lib.attrsets.nameValuePair "deploy-${hostname}" {
type = "app";
program = toString (pkgs.writers.writeDash "deploy-${hostname}" ''
exec nixos-rebuild switch --log-format internal-json --flake .?submodules=1#${hostname} --build-host ${targets.${hostname}} --target-host ${targets.${hostname}} 2>&1 | ${pkgs.nix-output-monitor}/bin/nom --json
'');
}) (builtins.attrNames self.nixosConfigurations));
};
nixosModules = { nixosModules = {
htgen = import modules/htgen.nix; htgen = import modules/htgen.nix;
@@ -147,15 +148,6 @@
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs = niveumSpecialArgs system; specialArgs = niveumSpecialArgs system;
modules = [ modules = [
{
_module.args.nixinate = {
host = "ful";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/ful/configuration.nix systems/ful/configuration.nix
agenix.nixosModules.default agenix.nixosModules.default
inputs.self.nixosModules.passport inputs.self.nixosModules.passport
@@ -168,15 +160,6 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = niveumSpecialArgs system; specialArgs = niveumSpecialArgs system;
modules = [ modules = [
{
_module.args.nixinate = {
host = "zaatar";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/zaatar/configuration.nix systems/zaatar/configuration.nix
inputs.self.nixosModules.moodle-dl inputs.self.nixosModules.moodle-dl
agenix.nixosModules.default agenix.nixosModules.default
@@ -188,15 +171,6 @@
# for using inputs in other config files # for using inputs in other config files
specialArgs = niveumSpecialArgs system; specialArgs = niveumSpecialArgs system;
modules = [ modules = [
{
_module.args.nixinate = {
host = "makanek";
sshUser = "root";
buildOn = "local";
substituteOnTarget = true;
hermetic = false;
};
}
systems/makanek/configuration.nix systems/makanek/configuration.nix
inputs.self.nixosModules.telegram-bot inputs.self.nixosModules.telegram-bot
inputs.self.nixosModules.htgen inputs.self.nixosModules.htgen
@@ -226,15 +200,6 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = niveumSpecialArgs system; specialArgs = niveumSpecialArgs system;
modules = [ modules = [
{
_module.args.nixinate = {
host = "manakish";
sshUser = "root";
buildOn = "local";
substituteOnTarget = true;
hermetic = false;
};
}
systems/manakish/configuration.nix systems/manakish/configuration.nix
agenix.nixosModules.default agenix.nixosModules.default
retiolum.nixosModules.retiolum retiolum.nixosModules.retiolum
@@ -247,15 +212,6 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = niveumSpecialArgs system; specialArgs = niveumSpecialArgs system;
modules = [ modules = [
{
_module.args.nixinate = {
host = "kabsa";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/kabsa/configuration.nix systems/kabsa/configuration.nix
agenix.nixosModules.default agenix.nixosModules.default
retiolum.nixosModules.retiolum retiolum.nixosModules.retiolum