From 636a19cb764f84f0b7c219db5ad4be41be8e9eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Mon, 22 Apr 2024 16:44:32 +0200 Subject: [PATCH] Generation 99 2024-04-22 16:05:47 (current) --- flake.nix | 23 +++++++++++++++++++++++ modules/bin/nix-scripts.nix | 13 +++++++++++++ 2 files changed, 36 insertions(+) diff --git a/flake.nix b/flake.nix index 83da621..5474887 100644 --- a/flake.nix +++ b/flake.nix @@ -82,5 +82,28 @@ ]; }; }; + homeConfigurations."jonas" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ({ + config, + pkgs, + ... + }: {nixpkgs.overlays = [overlay-unstable];}) + ( + {...}: {nixpkgs.config.allowUnfree = true;} + ) + inputs.plasma-manager.homeManagerModules.plasma-manager + inputs.sops-nix.homeManagerModules.sops + ./home/jonas/home.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = {inherit inputs;}; + }; }; } diff --git a/modules/bin/nix-scripts.nix b/modules/bin/nix-scripts.nix index df1ea08..5d78276 100644 --- a/modules/bin/nix-scripts.nix +++ b/modules/bin/nix-scripts.nix @@ -3,6 +3,19 @@ pkgs, ... }: let + home-rebuild = + pkgs.writeShellScriptBin ".home-rebuild" + '' + set -e + pushd ~/.nixos/ + ${pkgs.alejandra}/bin/alejandra . &>/dev/null + ${pkgs.git}/bin/git diff -U0 + echo "NixOS Rebuilding..." + ${pkgs.unstable.nh}/bin/nh home switch ~/.nixos + gen=$(home-manager generations | head -n1 | ${pkgs.awk} '{print "Gen" $5 " @ " $1}') + ${pkgs.git}/bin/git commit --no-gpg-sign -am "Home $gen" + popd + ''; rebuild = pkgs.writeShellScriptBin ".nixos-rebuild" ''