From 3b04de3a1dfd8ffe16021626570c430be1c37207 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:17:33 +0530 Subject: [PATCH] feat: add flake autoupgrade support for rahu --- flake.nix | 3 ++- hosts/rahu/configuration.nix | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index e4623b3..d852125 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ }; }; - outputs = { nixpkgs, home-manager, lanzaboote, ... }: { + outputs = inputs@{ self, nixpkgs, home-manager, lanzaboote, ... }: { formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; nixosConfigurations = { cafe-nosecureboot = nixpkgs.lib.nixosSystem { @@ -36,6 +36,7 @@ rahu = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = {inherit inputs;}; modules = [ ./hosts/rahu/configuration.nix ]; diff --git a/hosts/rahu/configuration.nix b/hosts/rahu/configuration.nix index c98ad0d..f01c9eb 100644 --- a/hosts/rahu/configuration.nix +++ b/hosts/rahu/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ inputs, config, pkgs, ... }: { imports = @@ -68,13 +68,24 @@ "d /media/seed 1777 transmission transmission" ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 14d"; }; - system.autoUpgrade.enable = true; + # system.autoUpgrade.enable = true; + system.autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + flags = [ + "--update-input" + "nixpkgs" + "--no-write-lock-file" + "-L" + ]; + }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.user = {