diff --git a/flake.nix b/flake.nix index 8dd8d0e..13250d4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,7 @@ { description = "Flake of LibrePhoenix"; - outputs = inputs@{ self, nixpkgs, nixpkgs-stable, emacs-pin-nixpkgs, kdenlive-pin-nixpkgs, - home-manager-unstable, home-manager-stable, nix-doom-emacs, - nix-straight, stylix, blocklist-hosts, rust-overlay, org-nursery, org-yaap, - org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: + outputs = inputs@{ self, ... }: let # ---- SYSTEM SETTINGS ---- # systemSettings = { @@ -51,9 +48,9 @@ # create patched nixpkgs nixpkgs-patched = - (import nixpkgs { system = systemSettings.system; }).applyPatches { + (import inputs.nixpkgs { system = systemSettings.system; }).applyPatches { name = "nixpkgs-patched"; - src = nixpkgs; + src = inputs.nixpkgs; patches = [ ./patches/emacs-no-version-check.patch ]; }; @@ -70,10 +67,10 @@ allowUnfree = true; allowUnfreePredicate = (_: true); }; - overlays = [ rust-overlay.overlays.default ]; + overlays = [ inputs.rust-overlay.overlays.default ]; })); - pkgs-stable = import nixpkgs-stable { + pkgs-stable = import inputs.nixpkgs-stable { system = systemSettings.system; config = { allowUnfree = true; @@ -81,11 +78,11 @@ }; }; - pkgs-emacs = import emacs-pin-nixpkgs { + pkgs-emacs = import inputs.emacs-pin-nixpkgs { system = systemSettings.system; }; - pkgs-kdenlive = import kdenlive-pin-nixpkgs { + pkgs-kdenlive = import inputs.kdenlive-pin-nixpkgs { system = systemSettings.system; }; @@ -94,17 +91,17 @@ # otherwise use patched nixos-unstable nixpkgs lib = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) then - nixpkgs-stable.lib + inputs.nixpkgs-stable.lib else - nixpkgs.lib); + inputs.nixpkgs.lib); # use home-manager-stable if running a server (homelab or worklab profile) # otherwise use home-manager-unstable home-manager = (if ((systemSettings.profile == "homelab") || (systemSettings.profile == "worklab")) then - home-manager-stable + inputs.home-manager-stable else - home-manager-unstable); + inputs.home-manager-unstable); # Systems that can run tests: supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ]; @@ -131,16 +128,7 @@ inherit pkgs-kdenlive; inherit systemSettings; inherit userSettings; - inherit (inputs) nix-doom-emacs; - inherit (inputs) org-nursery; - inherit (inputs) org-yaap; - inherit (inputs) org-side-tree; - inherit (inputs) org-timeblock; - inherit (inputs) org-krita; - inherit (inputs) org-sliced-images; - inherit (inputs) phscroll; - inherit (inputs) mini-frame; - inherit (inputs) stylix; + inherit inputs; }; }; }; @@ -156,8 +144,7 @@ inherit pkgs-stable; inherit systemSettings; inherit userSettings; - inherit (inputs) stylix; - inherit (inputs) blocklist-hosts; + inherit inputs; }; }; }; diff --git a/profiles/work/home.nix b/profiles/work/home.nix index b219182..16259ee 100644 --- a/profiles/work/home.nix +++ b/profiles/work/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, pkgs-kdenlive, nix-doom-emacs, stylix, userSettings, ... }: +{ config, pkgs, pkgs-kdenlive, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should @@ -9,8 +9,6 @@ programs.home-manager.enable = true; imports = [ - (if ((userSettings.editor == "emacs") || (userSettings.editor == "emacsclient")) then nix-doom-emacs.hmModule else null) - stylix.homeManagerModules.stylix (./. + "../../../user/wm"+("/"+userSettings.wm+"/"+userSettings.wm)+".nix") # My window manager selected from flake ../../user/shell/sh.nix # My zsh and bash config ../../user/shell/cli-collection.nix # Useful CLI apps diff --git a/profiles/wsl/home.nix b/profiles/wsl/home.nix index 794d7e1..7fb8ee7 100644 --- a/profiles/wsl/home.nix +++ b/profiles/wsl/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, nix-doom-emacs, stylix, userSettings, ... }: +{ config, pkgs, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should @@ -9,8 +9,6 @@ programs.home-manager.enable = true; imports = [ - (if ((userSettings.editor == "emacs") || (userSettings.editor == "emacsclient")) then nix-doom-emacs.hmModule else null) - stylix.homeManagerModules.stylix ../../user/shell/sh.nix # My zsh and bash config ../../user/shell/cli-collection.nix # Useful CLI apps ../../user/app/doom-emacs/doom.nix # My doom emacs config diff --git a/system/security/blocklist.nix b/system/security/blocklist.nix index c7d2792..0653a09 100644 --- a/system/security/blocklist.nix +++ b/system/security/blocklist.nix @@ -1,6 +1,6 @@ -{ blocklist-hosts, ... }: +{ inputs, ... }: -let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts"; +let blocklist = builtins.readFile "${inputs.blocklist-hosts}/alternates/gambling-porn/hosts"; in { networking.extraHosts = '' diff --git a/system/style/stylix.nix b/system/style/stylix.nix index d8fe483..7b7bf6b 100644 --- a/system/style/stylix.nix +++ b/system/style/stylix.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, stylix, userSettings, ... }: +{ lib, pkgs, inputs, userSettings, ... }: let themePath = "../../../themes/"+userSettings.theme+"/"+userSettings.theme+".yaml"; @@ -8,7 +8,7 @@ let backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+userSettings.theme)+"/backgroundsha256.txt"); in { - imports = [ stylix.nixosModules.stylix ]; + imports = [ inputs.stylix.nixosModules.stylix ]; stylix.autoEnable = false; stylix.polarity = themePolarity; diff --git a/user/app/doom-emacs/doom.nix b/user/app/doom-emacs/doom.nix index 6824bd9..4add4e2 100644 --- a/user/app/doom-emacs/doom.nix +++ b/user/app/doom-emacs/doom.nix @@ -1,11 +1,11 @@ -{ config, lib, pkgs-emacs, pkgs-stable, userSettings, systemSettings, - org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: +{ config, lib, pkgs-emacs, pkgs-stable, inputs, userSettings, systemSettings, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; in { imports = [ + inputs.nix-doom-emacs.hmModule ../git/git.nix ../../shell/sh.nix ../../shell/cli-collection.nix @@ -79,30 +79,30 @@ in }; home.file.".emacs.d/org-yaap" = { - source = "${org-yaap}"; + source = "${inputs.org-yaap}"; recursive = true; }; home.file.".emacs.d/org-side-tree" = { - source = "${org-side-tree}"; + source = "${inputs.org-side-tree}"; recursive = true; }; home.file.".emacs.d/org-timeblock" = { - source = "${org-timeblock}"; + source = "${inputs.org-timeblock}"; recursive = true; }; home.file.".emacs.d/org-nursery" = { - source = "${org-nursery}"; + source = "${inputs.org-nursery}"; }; home.file.".emacs.d/org-krita" = { - source = "${org-krita}"; + source = "${inputs.org-krita}"; }; home.file.".emacs.d/org-sliced-images" = { - source = "${org-sliced-images}"; + source = "${inputs.org-sliced-images}"; }; home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo; @@ -112,11 +112,11 @@ in }; home.file.".emacs.d/phscroll" = { - source = "${phscroll}"; + source = "${inputs.phscroll}"; }; home.file.".emacs.d/mini-frame" = { - source = "${mini-frame}"; + source = "${inputs.mini-frame}"; }; home.file.".emacs.d/system-vars.el".text = '' diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index 316f4d0..54a4fea 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -1983,14 +1983,14 @@ Any git package can be configured for a particular commit or branch: * Nix Integration In order to have Nix load my Doom Emacs configuration [[./doom.nix][doom.nix]], which I source in the =imports= block of my [[../../../profiles/work/home.nix][home.nix]]. #+BEGIN_SRC nix :tangle doom.nix -{ config, lib, pkgs-emacs, pkgs-stable, userSettings, systemSettings, - org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: +{ config, lib, pkgs-emacs, pkgs-stable, inputs, userSettings, systemSettings, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; in { imports = [ + inputs.nix-doom-emacs.hmModule ../git/git.nix ../../shell/sh.nix ../../shell/cli-collection.nix @@ -2064,30 +2064,30 @@ in }; home.file.".emacs.d/org-yaap" = { - source = "${org-yaap}"; + source = "${inputs.org-yaap}"; recursive = true; }; home.file.".emacs.d/org-side-tree" = { - source = "${org-side-tree}"; + source = "${inputs.org-side-tree}"; recursive = true; }; home.file.".emacs.d/org-timeblock" = { - source = "${org-timeblock}"; + source = "${inputs.org-timeblock}"; recursive = true; }; home.file.".emacs.d/org-nursery" = { - source = "${org-nursery}"; + source = "${inputs.org-nursery}"; }; home.file.".emacs.d/org-krita" = { - source = "${org-krita}"; + source = "${inputs.org-krita}"; }; home.file.".emacs.d/org-sliced-images" = { - source = "${org-sliced-images}"; + source = "${inputs.org-sliced-images}"; }; home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo; @@ -2097,11 +2097,11 @@ in }; home.file.".emacs.d/phscroll" = { - source = "${phscroll}"; + source = "${inputs.phscroll}"; }; home.file.".emacs.d/mini-frame" = { - source = "${mini-frame}"; + source = "${inputs.mini-frame}"; }; home.file.".emacs.d/system-vars.el".text = '' diff --git a/user/style/stylix.nix b/user/style/stylix.nix index 1fe5de0..c7d65d0 100644 --- a/user/style/stylix.nix +++ b/user/style/stylix.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, userSettings, ... }: +{ config, lib, pkgs, inputs, userSettings, ... }: let themePath = "../../../themes"+("/"+userSettings.theme+"/"+userSettings.theme)+".yaml"; @@ -7,6 +7,9 @@ let backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+userSettings.theme)+"/backgroundsha256.txt"); in { + + imports = [ inputs.stylix.homeManagerModules.stylix ]; + home.file.".currenttheme".text = userSettings.theme; stylix.autoEnable = false; stylix.polarity = themePolarity;