wip clan.lol
parent
892f5dc0f2
commit
93c9bd7176
81
flake.nix
81
flake.nix
|
@ -141,9 +141,9 @@
|
|||
#pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
meta = { nixpackages ? nixpkgs }: rec {
|
||||
meta = rec {
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpackages {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.permittedInsecurePackages = [
|
||||
|
@ -173,52 +173,25 @@
|
|||
(import ./nixos/pkgs)
|
||||
];
|
||||
};
|
||||
specialArgs = {
|
||||
inherit private_assets;
|
||||
assets = ./nixos/assets;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# todo : why redefine it?
|
||||
# Mic92 means, is not needed anymore
|
||||
# nixosSystem = args:
|
||||
# (lib.makeOverridable lib.nixosSystem)
|
||||
# (lib.recursiveUpdate args {
|
||||
# modules =
|
||||
# args.modules
|
||||
# ++ [
|
||||
# {
|
||||
# config.nixpkgs.pkgs = lib.mkDefault args.pkgs;
|
||||
# config.nixpkgs.localSystem = lib.mkDefault args.pkgs.stdenv.hostPlatform;
|
||||
# }
|
||||
# ];
|
||||
# });
|
||||
|
||||
# nixosConfigurationSetup =
|
||||
# { name
|
||||
# , modules
|
||||
# , nixpackages ? nixpkgs
|
||||
# }:
|
||||
# nixosSystem {
|
||||
# inherit (meta { nixpackages = nixpackages; }) system specialArgs pkgs;
|
||||
# modules = modules ++ defaultModules ++ [
|
||||
# {
|
||||
# imports = [
|
||||
# ./nixos/machines/${name}/configuration.nix
|
||||
# (sopsModule name)
|
||||
# ];
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
|
||||
clanSetup =
|
||||
{ name
|
||||
, host
|
||||
, modules
|
||||
, nixpackages ? meta.nixpkgs
|
||||
#, nixpackages ? meta.nixpkgs
|
||||
}: {
|
||||
|
||||
clan.networking.targetHost = lib.mkDefault "root@${host}";
|
||||
clanCore.machineIcon = null; # Optional, a path to an image file
|
||||
|
||||
nixpkgs.pkgs = nixpackages;
|
||||
#nixpkgs.pkgs = nixpackages;
|
||||
nixpkgs.pkgs = meta.pkgs;
|
||||
nixpkgs.hostPlatform = meta.system;
|
||||
|
||||
imports = modules ++ defaultModules ++ [
|
||||
|
@ -231,27 +204,19 @@
|
|||
];
|
||||
};
|
||||
|
||||
|
||||
defaultModules = [
|
||||
{
|
||||
# todo : find out what this is?
|
||||
# make flake inputs accessiable in NixOS
|
||||
_module.args.self = self;
|
||||
_module.args.inputs = self.inputs;
|
||||
}
|
||||
({ pkgs, lib, ... }:
|
||||
{
|
||||
# todo : check if this is still needed
|
||||
nix = {
|
||||
# no channesl needed this way
|
||||
nixPath = [ "nixpkgs=${pkgs.path}" ];
|
||||
# make flakes available
|
||||
package = pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
})
|
||||
({ pkgs, lib, ... }: {
|
||||
# todo : check if this is still needed
|
||||
nix = {
|
||||
# no channesl needed this way
|
||||
nixPath = [ "nixpkgs=${pkgs.path}" ];
|
||||
# make flakes available
|
||||
package = pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
})
|
||||
{ nix.settings.substituters = [ "https://cache.nixos.org/" ]; }
|
||||
({ pkgs, ... }: {
|
||||
boot.tmp.useTmpfs = lib.mkDefault true;
|
||||
|
@ -303,7 +268,7 @@
|
|||
};
|
||||
|
||||
sopsModule = name: { lib, ... }: {
|
||||
imports = [ sops-nix.nixosModules.sops ];
|
||||
#imports = [ sops-nix.nixosModules.sops ];
|
||||
sops.defaultSopsFile = lib.mkForce "${secrets}/secrets/${name}.yaml";
|
||||
};
|
||||
|
||||
|
@ -333,11 +298,11 @@
|
|||
nixos-hardware.nixosModules.lenovo-thinkpad-x220
|
||||
homeManagerModules
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
cream = clanSetup {
|
||||
name = "cream";
|
||||
#host = "1.2.3.4";
|
||||
host = "cream.private";
|
||||
modules = [
|
||||
nixos-hardware.nixosModules.framework-12th-gen-intel
|
||||
|
|
Loading…
Reference in New Issue