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

View file

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

View file

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

View file

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

View file

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