bunch of small changes

This commit is contained in:
Gerg-L 2023-10-08 21:04:23 -04:00
parent b99f465861
commit 75a4e0a52a
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
5 changed files with 57 additions and 41 deletions

14
flake.lock generated
View file

@ -207,16 +207,16 @@
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1695384831,
"narHash": "sha256-Ah4JBpKBFgOjXjhQBjaf7Zk9WYVk2ykcXPMeHpuoEyc=",
"lastModified": 1696671022,
"narHash": "sha256-Qs9hVi4sKOsvV3YjKJK16hF/XF4PZ8l7XzAipjyWMPU=",
"owner": "NixOS",
"repo": "nix",
"rev": "f89b84919c1a5c796512c50311821e7779b3678b",
"rev": "c29b8ba142a0650d1182ca838ddc1b2d273dcd2a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "f89b84919c1a5c796512c50311821e7779b3678b",
"ref": "c29b8ba142a0650d1182ca838ddc1b2d273dcd2a",
"repo": "nix",
"type": "github"
}
@ -380,11 +380,11 @@
]
},
"locked": {
"lastModified": 1696738534,
"narHash": "sha256-s+78173jpqZF4gUhjFAAEJbmv0acmUuungSHmT1eUn4=",
"lastModified": 1696788953,
"narHash": "sha256-Ya/R6KBM2BLXRU4lG4knszteAq09FXBsAHq5rW6RmOE=",
"owner": "Gerg-L",
"repo": "nvim-flake",
"rev": "91d65b5a185288994148425778a69f733f8569cd",
"rev": "4a502f7fd265b43e8de91c8968529d270f809c66",
"type": "github"
},
"original": {

View file

@ -6,7 +6,7 @@
stable.url = "github:NixOS/nixpkgs?ref=nixos-23.05";
nix = {
url = "github:NixOS/nix?ref=f89b84919c1a5c796512c50311821e7779b3678b";
url = "github:NixOS/nix?ref=c29b8ba142a0650d1182ca838ddc1b2d273dcd2a";
inputs.nixpkgs.follows = "stable";
};

View file

@ -4,6 +4,13 @@ _:
sops.secrets.cloudflare = { };
systemd.services.ddns = {
reloadIfChanged = false;
restartIfChanged = false;
stopIfChanged = false;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];

View file

@ -55,15 +55,15 @@ in
lib.evalModules {
specialArgs.modulesPath = "${unstable}/nixos/modules";
modules =
builtins.attrValues self.nixosModules
++ importAll "${self}/hosts/${name}"
++ [ {
modules = builtins.concatLists [
(builtins.attrValues self.nixosModules)
(importAll "${self}/hosts/${name}")
(import "${unstable}/nixos/modules/module-list.nix")
(lib.singleton {
networking.hostName = name;
nixpkgs.hostPlatform = system;
} ]
++ (import "${unstable}/nixos/modules/module-list.nix")
;
})
];
}
);
mkDisko =
@ -72,13 +72,15 @@ in
mkPackages =
path: pkgs:
builtins.listToAttrs (
map
(module: {
name = lib.removeSuffix ".nix" (builtins.baseNameOf module);
value = pkgs.callPackage module { };
})
(listNixFilesRecursive path)
);
lib.pipe path [
listNixFilesRecursive
(map (
x: {
name = lib.removeSuffix ".nix" (builtins.baseNameOf x);
value = pkgs.callPackage x { };
}
))
builtins.listToAttrs
];
_file = ./default.nix;
}

View file

@ -1,17 +1,28 @@
inputs:
{ pkgs, lib, ... }:
#
# Flake registry and $NIX_PATH pinning
#
let
alias = inputs // {
nixpkgs = inputs.unstable;
};
flakes = lib.filterAttrs (_: lib.isType "flake") alias;
in
{
nix.nixPath = lib.mapAttrsToList (x: _: "${x}=flake:${x}") flakes;
nix.registry = lib.mapAttrs (_: flake: { inherit flake; }) flakes;
pkgs,
lib,
config,
...
}:
{
#
# Flake registry and $NIX_PATH pinning
#
nix.registry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // { nixpkgs.flake = inputs.unstable; })
];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.nixPath = [ "/etc/nix/path" ];
#
# Ignore global registry
#
@ -32,7 +43,6 @@ in
"dynamic-derivations"
"fetch-closure"
"flakes"
"impure-derivations"
"nix-command"
"no-url-literals"
"parse-toml-timestamps"
@ -46,11 +56,8 @@ in
# Use for testing
#
#allow-import-from-derivation = false;
trusted-users = [
"root"
"@wheel"
];
allowed-users = [ ];
trusted-users = [ "root" ];
allowed-users = [ "@wheel" ];
use-xdg-base-directories = true;
auto-allocate-uids = true;
};