From 878129d2c97e3e833aee04f2a144d38e61fe611b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 18 Mar 2025 14:41:11 -0500 Subject: [PATCH] feat: out-of-store symlink options, start readme tweaks, bring back pa alias --- flake.nix | 10 ++++------ lib/default.nix | 7 +++++++ lib/modules/home/default.nix | 19 ++++++------------- packages/hosts/dragon.nix | 9 ++++++--- readme.md | 22 ++++++++-------------- 5 files changed, 31 insertions(+), 36 deletions(-) diff --git a/flake.nix b/flake.nix index 0f160cd..3e13211 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,11 @@ outputs = inputs: let - lib = import ./lib inputs; - uGenPkgs = lib.genPkgs inputs.nixpkgs-unstable; + flakeLib = import ./lib inputs; + uGenPkgs = flakeLib.genPkgs inputs.nixpkgs-unstable; in { + inherit flakeLib; packages = uGenPkgs (import ./packages); nixosConfigurations = import ./packages/hosts inputs; @@ -33,10 +34,7 @@ TODO: nixos ISO? */ } - // (import ./lib/constants.nix inputs) - // { - flakeLib = lib; - }; + // (import ./lib/constants.nix inputs); inputs = { # stable inputs diff --git a/lib/default.nix b/lib/default.nix index 1fc112b..88d42d6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -18,5 +18,12 @@ rec { pkgsFor = nixpkgs: system: (import nixpkgs { inherit system; }).extend forSelfOverlay; genPkgs = nixpkgs: func: (forSystems nixpkgs (system: func (pkgsFor nixpkgs system))); + conditionalOutOfStoreSymlink = + config: outOfStoreSymlink: relPath: + if config.lyte.useOutOfStoreSymlinks.enable then + config.lib.file.mkOutOfStoreSymlink outOfStoreSymlink + else + relPath; + inherit (import ./host.nix inputs) host stableHost; } diff --git a/lib/modules/home/default.nix b/lib/modules/home/default.nix index ba30a8a..b1c1381 100644 --- a/lib/modules/home/default.nix +++ b/lib/modules/home/default.nix @@ -2,6 +2,7 @@ let inherit (self) outputs; inherit (outputs) homeManagerModules style; + inherit (self.flakeLib) conditionalOutOfStoreSymlink; in { default = @@ -52,6 +53,9 @@ in { options = { lyte = { + useOutOfStoreSymlinks = { + enable = lib.mkEnableOption "Enable the use of mkOutOfStoreSymlink for certain configuration files for faster editing, but means /etc/nixos and /etc/nix/flake must point to this flake in order to work"; + }; shell = { enable = lib.mkEnableOption "Enable home-manager shell configuration for the user"; learn-jujutsu-not-git = { @@ -206,17 +210,6 @@ in }; }; - eww = - { config, ... }: - { - # programs.eww = { - # enable = true; - # }; - - home.file.".config/eww".source = - config.lib.file.mkOutOfStoreSymlink /etc/nixos/modules/home-manager/eww; - }; - cargo = { config, ... }: { @@ -675,7 +668,7 @@ in disks = "df -h && lsblk"; sctl = "sudo systemctl"; bt = "bluetoothctl"; - pa = "pulsemixer"; + pa = "nix run nixpkgs#pulsemixer"; sctlu = "systemctl --user"; }; @@ -767,7 +760,7 @@ in ]; home.file."${config.xdg.configHome}/ghostty" = { - source = config.lib.file.mkOutOfStoreSymlink /etc/nix/flake/lib/modules/home/ghostty; + source = conditionalOutOfStoreSymlink config /etc/nix/flake/lib/modules/home/ghostty ./ghostty; }; }; }; diff --git a/packages/hosts/dragon.nix b/packages/hosts/dragon.nix index a57d8f7..2016866 100644 --- a/packages/hosts/dragon.nix +++ b/packages/hosts/dragon.nix @@ -51,9 +51,12 @@ lyte.desktop.enable = true; home-manager.users.daniel = { - lyte.shell = { - enable = true; - learn-jujutsu-not-git.enable = true; + lyte = { + useOutOfStoreSymlinks.enable = true; + shell = { + enable = true; + learn-jujutsu-not-git.enable = true; + }; }; lyte.desktop.enable = true; slippi-launcher = { diff --git a/readme.md b/readme.md index 79bef53..f841335 100644 --- a/readme.md +++ b/readme.md @@ -10,21 +10,15 @@ Nix for lytedev -My grand, declarative, and unified application, service, environment, and -machine configuration, secret, and package management in a single flake. ❤️ ❄️ +My Nix monorepo and main Flake. -**NOTE**: Everything in here is highly specific to my personal preference. I -can't recommend you actually use this in any way, but hopefully some stuff in -here is useful inspiration. - -**NOTE**: I use some out-of-store symlinks for quicker configuration iteration, -so you will ultimately want to clone this repo somewhere and create the -following symlinks: - -```shell -ln -s $REPO /etc/nix/flake -ln -s $REPO /etc/nixos # only for nixos systems -``` +- Desktop configurations +- Laptop configurations +- Home server configurations +- Remote server configurations +- Home router configurations +- Packages +- Fonts # Quick Start