diff --git a/common/environment.nix b/common/environment.nix index 122e2f5..384e88d 100644 --- a/common/environment.nix +++ b/common/environment.nix @@ -12,11 +12,6 @@ lsof tcpdump netcat # <3 - - # used for nix config - colmena - agenix - rc2nix ]; environment.wordlist.enable = true; diff --git a/common/home-manager.nix b/common/home-manager.nix index e4d7106..171a382 100644 --- a/common/home-manager.nix +++ b/common/home-manager.nix @@ -1,13 +1,9 @@ { config, lib, pkgs, ... }: { - home-manager.users = { - qenya = { config, lib, pkgs, osConfig, ... }: { - home.homeDirectory = osConfig.users.users.qenya.home; - - imports = [ - ../home/qenya - ]; - }; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; }; } diff --git a/common/users/qenya.nix b/common/users/qenya.nix index e9d11ad..19dc8ed 100644 --- a/common/users/qenya.nix +++ b/common/users/qenya.nix @@ -11,4 +11,9 @@ in { }; programs.zsh.enable = true; + + home-manager.users.qenya = { config, lib, pkgs, osConfig, ... }: { + home.homeDirectory = osConfig.users.users.qenya.home; + imports = [ ../../home/qenya ]; + }; } diff --git a/flake.nix b/flake.nix index 9746dec..7f3b793 100644 --- a/flake.nix +++ b/flake.nix @@ -42,18 +42,8 @@ nix.nixPath = [ "nixpkgs=flake:nixpkgs" ]; nixpkgs.config.allowUnfree = true; - nixpkgs.config.packageOverrides = pkgs: { - agenix = inputs.agenix.packages.${config.nixpkgs.hostPlatform.system}.default; - rc2nix = inputs.plasma-manager.packages.${config.nixpkgs.hostPlatform.system}.rc2nix; - }; - nixpkgs.overlays = [ inputs.nur.overlay ]; - - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - backupFileExtension = "backup"; - sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; - }; + nixpkgs.overlays = [ nur.overlay ]; + home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; imports = [ home-manager.nixosModules.home-manager @@ -98,5 +88,19 @@ ]; }; }; + + # TODO: have this work on other systems too + devShells."x86_64-linux".default = + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in + pkgs.mkShell { + packages = [ + pkgs.colmena + agenix.packages.${system}.default + plasma-manager.packages.${system}.rc2nix + ]; + }; }; } diff --git a/home/qenya/zsh.nix b/home/qenya/zsh.nix index f6ded78..42ccf8f 100644 --- a/home/qenya/zsh.nix +++ b/home/qenya/zsh.nix @@ -25,6 +25,15 @@ theme = "agnoster"; }; + initExtra = '' + # If a shell is started in a directory with a shell.nix, automatically run nix-shell + if [ -f ./shell.nix ]; then + if [ -z "$IN_NIX_SHELL" ]; then + nix-shell --command "zsh" + fi + fi + ''; + envExtra = '' DEFAULT_USER=qenya ''; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..688ef15 --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +let + shell = (import + (fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/refs/tags/v1.0.1.tar.gz"; + sha256 = "0jm6nzb83wa6ai17ly9fzpqc40wg1viib8klq8lby54agpl213w5"; + }) + { src = ./.; }).shellNix; +in +shell.devShells.${builtins.currentSystem}