From 142ada9298e648675e73b37412f9c5d7c691b742 Mon Sep 17 00:00:00 2001 From: willemml Date: Fri, 17 Mar 2023 15:48:56 -0700 Subject: [PATCH] fix home-switch, add home-build --- apps/home-build.nix | 13 +++++++++++++ apps/home-switch.nix | 4 +++- flake-parts/home-manager/modules.nix | 3 +-- home-manager/modules/custom/nixpkgs.nix | 17 +++++++++++++++++ .../modules/profiles/user/willem/base.nix | 19 ------------------- .../profiles/user/willem/programs/firefox.nix | 4 ++-- 6 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 apps/home-build.nix create mode 100644 home-manager/modules/custom/nixpkgs.nix diff --git a/apps/home-build.nix b/apps/home-build.nix new file mode 100644 index 0000000..b1ead96 --- /dev/null +++ b/apps/home-build.nix @@ -0,0 +1,13 @@ +{ writeShellApplication +, home-manager +, stdenv +, +}: +writeShellApplication { + name = "home-build"; + runtimeInputs = [ home-manager ]; + text = '' + export FLAKE_CONFIG_URI=".#homeConfigurations.${stdenv.hostPlatform.system}.$USER" + exec home-manager build "$@" + ''; +} diff --git a/apps/home-switch.nix b/apps/home-switch.nix index 45506f3..be4847e 100644 --- a/apps/home-switch.nix +++ b/apps/home-switch.nix @@ -1,11 +1,13 @@ { writeShellApplication , home-manager +, stdenv , }: writeShellApplication { name = "home-switch"; runtimeInputs = [ home-manager ]; text = '' - exec home-manager switch --flake . "$@" + export FLAKE_CONFIG_URI=".#homeConfigurations.${stdenv.hostPlatform.system}.$USER" + exec home-manager switch "$@" ''; } diff --git a/flake-parts/home-manager/modules.nix b/flake-parts/home-manager/modules.nix index d76dc6e..100c597 100644 --- a/flake-parts/home-manager/modules.nix +++ b/flake-parts/home-manager/modules.nix @@ -20,14 +20,13 @@ }; nixpkgs-Config = { - nixpkgs.config.allowUnfreePredicate = lib.const true; + nixpkgs.config.allowUnfreePredicate = (_: true); nixpkgs.config.allowUnsupportedSystem = true; nixpkgs.overlays = builtins.attrValues self.overlays; }; nixpkgs-useFlakeNixpkgs = { home.sessionVariables.NIX_PATH = "nixpkgs=${inputs.nixpkgs}"; - systemd.user.sessionVariables.NIX_PATH = lib.mkForce "nixpkgs=${inputs.nixpkgs}"; nix.registry.nixpkgs.flake = inputs.nixpkgs; }; } diff --git a/home-manager/modules/custom/nixpkgs.nix b/home-manager/modules/custom/nixpkgs.nix new file mode 100644 index 0000000..3ea6262 --- /dev/null +++ b/home-manager/modules/custom/nixpkgs.nix @@ -0,0 +1,17 @@ +{ + home.file = { + ".config/nix/nix.conf".text = '' + allow-dirty = true + experimental-features = flakes nix-command repl-flake + builders-use-substitutes = true + ''; + ".config/nixpkgs/config.nix".text = '' + # -*-nix-*- + { + nixpkgs.config.allowUnfreePredicate = (_: true); + allowUnfree = true; + } + + ''; + }; +} diff --git a/home-manager/modules/profiles/user/willem/base.nix b/home-manager/modules/profiles/user/willem/base.nix index 7916f1f..24c9622 100644 --- a/home-manager/modules/profiles/user/willem/base.nix +++ b/home-manager/modules/profiles/user/willem/base.nix @@ -5,25 +5,6 @@ let in rec { home = { - file = { - ".config/nix/nix.conf".text = '' - allow-dirty = true - experimental-features = flakes nix-command repl-flake - builders-use-substitutes = true - ''; - ".config/nixpkgs/config.nix".text = '' - # -*-nix-*- - { - packageOverrides = pkgs: { - nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { - inherit pkgs; - }; - }; - allowUnfree = true; - } - - ''; - }; homeDirectory = "/Users/willem"; keyboard = { layout = "us"; diff --git a/home-manager/modules/profiles/user/willem/programs/firefox.nix b/home-manager/modules/profiles/user/willem/programs/firefox.nix index bc36f0a..2199bec 100644 --- a/home-manager/modules/profiles/user/willem/programs/firefox.nix +++ b/home-manager/modules/profiles/user/willem/programs/firefox.nix @@ -73,9 +73,9 @@ #bypass-paywalls-clean clearurls don-t-fuck-with-paste - dracula-dark-colorscheme + #dracula-dark-colorscheme edit-with-emacs - fastforward + #fastforward i-dont-care-about-cookies musescore-downloader offline-qr-code-generator