From 890be0959b4cbf7a806ab842af806cbcaf6c2ca7 Mon Sep 17 00:00:00 2001 From: mat ess Date: Fri, 3 Nov 2023 21:31:47 -0400 Subject: [PATCH] More tidying --- README.md | 73 ++++++++++-------------------- flake.lock | 17 ------- flake.nix | 6 +-- home/services/dark-mode-notify.nix | 2 +- nixos/nix.nix | 1 + pkgs/default.nix | 3 -- pkgs/recursive-patched.nix | 2 +- users/default.nix | 8 ++-- 8 files changed, 31 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index b27213a..f03e04f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # dotfiles.nix -nix user configuration for nix-darwin and home-manager. +nix user configuration for nix{-darwin,OS} and home-manager. -spiritually a fork of https://github.com/malob/nixpkgs, but using a repo i already had lying around +relies heavily on [flake.parts](https://flake.parts) for organization. ## installation ```shell @@ -20,58 +20,33 @@ main entry point and glue for submodules [nix-darwin](https://github.com/LnL7/nix-darwin) specific configuration -#### bootstrap.nix - -minimal configuration for a base macOS system - -#### default.nix - -full featured macOS system - -#### homebrew.nix - -homebrew + mac app store apps - -#### defaults.nix - -macOS system settings - ### home [home-manager](https://github.com/nix-community/home-manager) configuration -#### configs +### nixos -simple configurations - -#### default.nix - -main user environment configuration - -#### kitty.nix - -kitty terminal configuration and integrations - -#### shells.nix - -fish shell configuration and integrations - -### modules - -#### darwin - -various extensions for nix-darwin configuration - -#### home - -customization for kitty terminal and other programs - -### overlays - -#### colors - -pure nix colorscheme palettes +nixos specific configuration ### pkgs -custom-built nix packages in a sub-flake +overlay with some additional packages + +### systems + +system-specific bits of configuration, relating to a particular host or type of hosts + +### templates + +nix flake templates for flake-based projects + +### users + +flake-wide user configuration + +## grafts + +this is a painfully incomplete list of some of the more directly inspirations for this repo: + +- https://github.com/srid/nixos-config +- https://github.com/malob/nixpkgs diff --git a/flake.lock b/flake.lock index dc2c0e6..5f933bb 100644 --- a/flake.lock +++ b/flake.lock @@ -30,22 +30,6 @@ "type": "github" } }, - "dark-mode-notify-src": { - "flake": false, - "locked": { - "lastModified": 1658150829, - "narHash": "sha256-LsAQ5v5jgJw7KsJnQ3Mh6+LNj1EMHICMoD5WzF3hRmU=", - "owner": "bouk", - "repo": "dark-mode-notify", - "rev": "4d7fe211f81c5b67402fad4bed44995344a260d1", - "type": "github" - }, - "original": { - "owner": "bouk", - "repo": "dark-mode-notify", - "type": "github" - } - }, "disko": { "inputs": { "nixpkgs": [ @@ -567,7 +551,6 @@ }, "root": { "inputs": { - "dark-mode-notify-src": "dark-mode-notify-src", "disko": "disko", "fish-plugin-autopair": "fish-plugin-autopair", "fish-plugin-colored-man-pages": "fish-plugin-colored-man-pages", diff --git a/flake.nix b/flake.nix index 7bfce8a..4753351 100644 --- a/flake.nix +++ b/flake.nix @@ -30,10 +30,6 @@ nixd.url = "github:nix-community/nixd"; nixd.inputs.nixpkgs.follows = "nixpkgs"; - # trigger some action when switching between dark and light mode on macOS - dark-mode-notify-src.url = "github:bouk/dark-mode-notify"; - dark-mode-notify-src.flake = false; - # iA writer fonts ia-writer-family-src.url = "github:iaolo/iA-Fonts"; ia-writer-family-src.flake = false; @@ -121,7 +117,6 @@ "nixd" ]; - # pre-commit hook configuration pre-commit.settings.hooks = { deadnix.enable = true; nil.enable = true; @@ -129,6 +124,7 @@ statix.enable = true; }; + # TODO: how to set legacy packages with overrides, etc? packages.default = self'.packages.activate; devShells.default = pkgs.mkShell { shellHook = '' diff --git a/home/services/dark-mode-notify.nix b/home/services/dark-mode-notify.nix index 1413c5f..5613106 100644 --- a/home/services/dark-mode-notify.nix +++ b/home/services/dark-mode-notify.nix @@ -10,7 +10,7 @@ StandardErrorPath = "${logPath}/error.log"; StandardOutPath = "${logPath}/out.log"; ProgramArguments = [ - "${lib.getExe pkgs.dark-mode-notify}" + "${lib.getExe' pkgs.dark-mode-notify "dark-mode-notify"}" "${lib.getExe pkgs.fish}" "-c" "set-background-to-env DARKMODE" diff --git a/nixos/nix.nix b/nixos/nix.nix index 89f3a64..5709d80 100644 --- a/nixos/nix.nix +++ b/nixos/nix.nix @@ -26,6 +26,7 @@ }; settings = { # TODO: automatic optimizing and gc + # https://github.com/montchr/dotfield/blob/main/profiles/darwinProfiles/core/nix-optimizations-darwin.nix experimental-features = [ "nix-command" "flakes" "repl-flake" ]; extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [ "x86_64-darwin" diff --git a/pkgs/default.nix b/pkgs/default.nix index b0ea64e..2f0092b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,8 +1,5 @@ inputs: self: super: { inherit (inputs) terminal-themes; - dark-mode-notify = self.callPackage ./dark-mode-notify.nix { - inherit (inputs) dark-mode-notify-src; - }; # get flake inputs prefixed with fish-plugin- and inject them into fishPlugins as a single list fishPlugins = super.fishPlugins // { flakePlugins = let diff --git a/pkgs/recursive-patched.nix b/pkgs/recursive-patched.nix index 8ff092c..5f00942 100644 --- a/pkgs/recursive-patched.nix +++ b/pkgs/recursive-patched.nix @@ -1,4 +1,4 @@ -{ nerd-font-patcher, stdenv, recursive }: +{ stdenv, nerd-font-patcher, recursive }: stdenv.mkDerivation { name = "recursive-nerd-font-patched"; src = recursive; diff --git a/users/default.nix b/users/default.nix index 140a38c..b24c21c 100644 --- a/users/default.nix +++ b/users/default.nix @@ -41,10 +41,8 @@ let }; in { # TODO: can we hack in an assertion that `me` is a key in `users`? - options = { users = lib.mkOption { type = usersSubmodule; }; }; - config = { - users = (import ./config.nix) // { - me' = lib.mkDefault config.users.users.${config.users.me}; - }; + options.users = lib.mkOption { type = usersSubmodule; }; + config.users = (import ./config.nix) // { + me' = lib.mkDefault config.users.users.${config.users.me}; }; }