diff --git a/flake.lock b/flake.lock index 5fcba7d..801872b 100644 --- a/flake.lock +++ b/flake.lock @@ -181,11 +181,11 @@ ] }, "locked": { - "lastModified": 1695984718, - "narHash": "sha256-LQwKgaaaFOkIcxarf0xQXeDJFwZ5BZWcgmPeo3xp2CM=", + "lastModified": 1699783872, + "narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=", "owner": "nix-community", "repo": "home-manager", - "rev": "4f02e35f9d150573e1a710afa338846c2f6d850c", + "rev": "280721186ab75a76537713ec310306f0eba3e407", "type": "github" }, "original": { @@ -201,11 +201,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1696036838, - "narHash": "sha256-GmzS2RWWG98Lw/NsXlBpVxBfH9deP6UtyB/IKj/vKUw=", + "lastModified": 1700011274, + "narHash": "sha256-NtZqLNEjgaCGowT2+HEeOoZsXqVSAZMA/vk2t0jikN0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "d9c11ddc1817497981466faba1fc7b8d1ea4f865", + "rev": "a8c236477b4251ba739463de7e863a07b124fdd3", "type": "github" }, "original": { @@ -237,11 +237,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1695887975, - "narHash": "sha256-u3+5FR12dI305jCMb0fJNQx2qwoQ54lv1tPoEWp0hmg=", + "lastModified": 1699997707, + "narHash": "sha256-ugb+1TGoOqqiy3axyEZpfF6T4DQUGjfWZ3Htry1EfvI=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "adcfd6aa860d1d129055039696bc457af7d50d0e", + "rev": "5689f3ebf899f644a1aabe8774d4f37eb2f6c2f9", "type": "github" }, "original": { @@ -269,11 +269,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1695825837, - "narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=", + "lastModified": 1699596684, + "narHash": "sha256-XSXP8zjBZJBVvpNb2WmY0eW8O2ce+sVyj1T0/iBRIvg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e", + "rev": "da4024d0ead5d7820f6bd15147d3fe2a0c0cec73", "type": "github" }, "original": { @@ -285,11 +285,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1694908564, - "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", + "lastModified": 1699756042, + "narHash": "sha256-bHHjQQBsEPOxLL+klYU2lYshDnnWY12SewzQ7n5ab2M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "596611941a74be176b98aeba9328aa9d01b8b322", + "rev": "9502d0245983bb233da8083b55d60d96fd3c29ff", "type": "github" }, "original": { @@ -301,27 +301,27 @@ }, "nixpkgs_2": { "locked": { - "dirtyRev": "5b78f2a4b69d95016f8dd9f2e931cbf83d4dab07-dirty", - "dirtyShortRev": "5b78f2a4-dirty", - "lastModified": 1695994956, - "narHash": "sha256-cFTJutLWWzMhidPHVDgBjdr4BtarTshnbAnvGbGvfOg=", - "shallow": true, - "type": "git", - "url": "file:///home/xin/repo/GitHub/xinyangli/nixpkgs" + "lastModified": 1699781429, + "narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e44462d6021bfe23dfb24b775cc7c390844f773d", + "type": "github" }, "original": { - "shallow": true, - "type": "git", - "url": "file:///home/xin/repo/GitHub/xinyangli/nixpkgs" + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nur": { "locked": { - "lastModified": 1696042552, - "narHash": "sha256-/n20VRUYywPiV5MS9eUoFMbuvX8m0gM3pHdKHW8Ah64=", + "lastModified": 1700012630, + "narHash": "sha256-m+FOsAtH3He/QoiPqJ/MuF9aw0P/+47vZ3H24pB9MaI=", "owner": "nix-community", "repo": "NUR", - "rev": "33b3ce67676a10b875dc58d187120b47e61b90a3", + "rev": "89fdcae74a069abd30b4d26ed043853b338ba88c", "type": "github" }, "original": { @@ -396,11 +396,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1695284550, - "narHash": "sha256-z9fz/wz9qo9XePEvdduf+sBNeoI9QG8NJKl5ssA8Xl4=", + "lastModified": 1699951338, + "narHash": "sha256-1GeczM7XfgHcYGYiYNcdwSFu3E62vmh4d7mffWZvyzE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "2f375ed8702b0d8ee2430885059d5e7975e38f78", + "rev": "0e3a94167dcd10a47b89141f35b2ff9e04b34c46", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0a388ab..aed019b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { - # nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs.url = "/home/xin/repo/GitHub/xinyangli/nixpkgs"; + # Pin nixpkgs to a specific commit + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05"; home-manager = { diff --git a/home/xin/common/default.nix b/home/xin/common/default.nix index 3c665c6..088d6a6 100644 --- a/home/xin/common/default.nix +++ b/home/xin/common/default.nix @@ -26,7 +26,6 @@ tealdeer neofetch rclone - clash inetutils ]; diff --git a/machines/calcite/configuration.nix b/machines/calcite/configuration.nix index a5d45f8..ffc1a28 100644 --- a/machines/calcite/configuration.nix +++ b/machines/calcite/configuration.nix @@ -7,7 +7,6 @@ ./hardware-configuration.nix ./network.nix ../sops.nix - ../clash.nix ]; # Bootloader. diff --git a/machines/clash.nix b/machines/clash.nix deleted file mode 100644 index e6c76ca..0000000 --- a/machines/clash.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - sops = { - secrets.clash_subscription_link = { - owner = "xin"; - }; - }; - - systemd.timers."clash-config-update" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnUnitActiveSec = "1d"; - Unit = "clash-config-update.service"; - }; - }; - - systemd.services."clash-config-update" = { - script = '' - ${pkgs.curl}/bin/curl $(${pkgs.coreutils}/bin/cat ${config.sops.secrets.clash_subscription_link.path}) > /tmp/config.yaml && mv /tmp/config.yaml /home/xin/.config/clash/ - ''; - serviceConfig = { - Type = "oneshot"; - User= "xin"; - }; - }; - - systemd.services.clash = { - enable = true; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig.ExecStart = "${pkgs.clash}/bin/clash -d /home/xin/.config/clash"; - }; - -} diff --git a/machines/massicot/default.nix b/machines/massicot/default.nix index 9d48c08..955d647 100644 --- a/machines/massicot/default.nix +++ b/machines/massicot/default.nix @@ -46,5 +46,11 @@ ]; hashedPassword = "$y$j9T$JOJn97hZndiDamUmmT.iq.$ue7gNZz/b14ur8GhyutOCvFjsv.3rcsHmk7m.WRk6u7"; }; + + security.sudo.extraRules = [ + { users = [ "xin" ]; + commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; + } + ]; } diff --git a/machines/raspite/configuration.nix b/machines/raspite/configuration.nix index b178e9e..72b7978 100644 --- a/machines/raspite/configuration.nix +++ b/machines/raspite/configuration.nix @@ -10,13 +10,11 @@ ]; imports = [ - ../clash.nix ../sops.nix ]; environment.systemPackages = with pkgs; [ git - clash ]; # Use mirror for binary cache @@ -59,4 +57,4 @@ hashedPassword = "$y$j9T$KEOMZBlXtudOYWq/elAdI.$Vd3X8rjEplbuRBeZPp.8/gpL3zthpBNjhBR47wFc8D4"; }; -} \ No newline at end of file +}