From 7fd47c51c033c956ff99b91b0bd0c2524ae87455 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Mon, 25 Nov 2024 14:27:52 +0100 Subject: [PATCH] move to dataset --- common/tooling/git.nix | 1 + common/tooling/nix.nix | 17 +++++++++++++++-- flake.lock | 19 ++++++++++--------- flake.nix | 6 +++--- .../hardware-configuration.nix | 6 ++++++ users.nix | 1 + 6 files changed, 36 insertions(+), 14 deletions(-) diff --git a/common/tooling/git.nix b/common/tooling/git.nix index c0c6935..991e1a9 100644 --- a/common/tooling/git.nix +++ b/common/tooling/git.nix @@ -36,6 +36,7 @@ in push.autoSetupRemote = true; core.autocrlf = "input"; commit.gpgsign = true; + safe.directory = "/etc/nixos"; core.excludesfile = ( pkgs.writeText ".gitignore" '' .idea diff --git a/common/tooling/nix.nix b/common/tooling/nix.nix index 2bf91a7..23e8437 100644 --- a/common/tooling/nix.nix +++ b/common/tooling/nix.nix @@ -3,7 +3,6 @@ environment.systemPackages = with pkgs; [ (writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@") (writeShellScriptBin "nixpkgs-review-head" "nixpkgs-review rev HEAD") - (writeShellScriptBin "rebuild" "bash -c \"nixos-rebuild switch |& nom\"") nixpkgs-review nixfmt-rfc-style @@ -16,7 +15,13 @@ nix-init ]; - environment.sessionVariables = lib.mkIf pkgs.config.allowUnfree { NIXPKGS_ALLOW_UNFREE = "1"; }; + environment.sessionVariables = + (lib.mkIf pkgs.config.allowUnfree { NIXPKGS_ALLOW_UNFREE = "1"; }) + // { + NH_NOM = 1; + }; + + environment.shellAliases."rebuild" = "nixos-rebuild switch |& nom"; grimmShared.tooling.lang_servers = [ { @@ -35,6 +40,14 @@ ]; warn-dirty = false; }; + + programs.nh = { + enable = true; + # clean.enable = true; + clean.extraArgs = "--keep-since 14d --keep 16"; + flake = "/etc/nixos"; + }; + nix.gc = { automatic = true; dates = "weekly"; diff --git a/flake.lock b/flake.lock index da1f871..75a7b71 100644 --- a/flake.lock +++ b/flake.lock @@ -366,17 +366,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732297877, - "narHash": "sha256-OCazAn/xPjPTMo6cyMzJthmfMBuoCjcZ4O+kAkW3ixI=", - "ref": "refs/heads/apparmor_module", - "rev": "43d89bd05155f93038565672464931594b9b4fcd", - "revCount": 710089, - "type": "git", - "url": "file:///home/grimmauld/coding/nixpkgs" + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "type": "github" }, "original": { - "type": "git", - "url": "file:///home/grimmauld/coding/nixpkgs" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-24_05": { diff --git a/flake.nix b/flake.nix index 8df05c0..b56a23f 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,8 @@ inputs = { nixpkgs = { - # url = "github:NixOS/nixpkgs/nixos-unstable"; - url = "git+file:///home/grimmauld/coding/nixpkgs"; + url = "github:NixOS/nixpkgs/nixos-unstable"; + # url = "git+file:///home/grimmauld/coding/nixpkgs"; }; chaotic = { url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; @@ -37,7 +37,7 @@ outputs = inputs @ { self, agenix, nixpkgs, chaotic, aagl-gtk-on-nix, nixos-mailserver, nixos-matrix-modules, aa-alias-manager, ... }: let patches = [ - # ./aa_mod.patch + ./aa_mod.patch { url = "https://github.com/NixOS/nixpkgs/pull/357468.patch"; hash = "sha256-t+/zVO/Jyink9biD61AuDOmVt0GF3biKxR5hCAyl4Fc="; diff --git a/specific/grimm-nixos-ssd/hardware-configuration.nix b/specific/grimm-nixos-ssd/hardware-configuration.nix index 006a8a6..4ee43f9 100644 --- a/specific/grimm-nixos-ssd/hardware-configuration.nix +++ b/specific/grimm-nixos-ssd/hardware-configuration.nix @@ -43,6 +43,12 @@ { device = "zpool/var"; fsType = "zfs"; }; + + fileSystems."/etc/nixos" = + { device = "zpool/nix_conf"; + fsType = "zfs"; + options = [ "noacl" ]; + }; # fileSystems."/home" = # { device = "zpool/home"; diff --git a/users.nix b/users.nix index df44380..0229c98 100644 --- a/users.nix +++ b/users.nix @@ -10,6 +10,7 @@ # shell = pkgs.xonsh; description = "grimmauld"; + openssh.authorizedKeys.keys = (import ./authorizedKeys.nix); extraGroups = lib.intersectLists (lib.attrNames config.users.groups) [ "networkmanager"