From a79991d5c941f2db452336a276a76245898f635c Mon Sep 17 00:00:00 2001 From: Matthew Ess Date: Thu, 15 Sep 2022 17:17:21 -0400 Subject: [PATCH] Big reorg based on malob --- README.md | 2 +- configs/init.vim | 40 ------ darwin.nix | 7 - darwin/bootstrap.nix | 50 ++++---- darwin/dark-mode-notify-service.nix | 21 +++ darwin/{macos-defaults.nix => defaults.nix} | 5 +- darwin/{default.nix => general.nix} | 22 ---- darwin/homebrew.nix | 7 +- flake.nix | 134 ++++++++++++-------- home/files.nix | 15 +++ home/{shells.nix => fish.nix} | 52 ++------ home/git.nix | 5 +- home/{default.nix => programs.nix} | 43 +------ home/starship.nix | 22 ++++ modules/darwin/primary-user.nix | 26 ++++ modules/darwin/programs/nix-index.nix | 17 --- modules/darwin/users.nix | 14 -- nixpkgs.nix | 6 - 18 files changed, 217 insertions(+), 271 deletions(-) delete mode 100644 configs/init.vim delete mode 100644 darwin.nix create mode 100644 darwin/dark-mode-notify-service.nix rename darwin/{macos-defaults.nix => defaults.nix} (87%) rename darwin/{default.nix => general.nix} (72%) create mode 100644 home/files.nix rename home/{shells.nix => fish.nix} (84%) rename home/{default.nix => programs.nix} (75%) create mode 100644 home/starship.nix create mode 100644 modules/darwin/primary-user.nix delete mode 100644 modules/darwin/programs/nix-index.nix delete mode 100644 modules/darwin/users.nix delete mode 100644 nixpkgs.nix diff --git a/README.md b/README.md index 5314dde..ecd467e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ spiritually a fork of https://github.com/malob/nixpkgs, but using a repo i alrea ## installation ```shell -$ nix build .#darwinConfigurations.matbook.system +$ nix build .#configurations.matbook.system $ ./result/sw/bin/darwin-rebuild switch --flake . ``` diff --git a/configs/init.vim b/configs/init.vim deleted file mode 100644 index 674c634..0000000 --- a/configs/init.vim +++ /dev/null @@ -1,40 +0,0 @@ -syntax on -filetype plugin indent on -set cursorline "highlight current line -set showmatch "highlight matching [{()}] -set tabstop=2 "number of visual spaces per TAB when reading -set softtabstop=2 "number of spaces per TAB when editing -set expandtab "tabs are spaces -set shiftwidth=2 "indents -set ww=<,>,[,] "wrap -set splitbelow "split underneath -set splitright "split to the right - -command Mks NERDTreeClose | mksession! -command Term split | term -command Vterm vsplit | term - -"save readonly -cmap w!! w !sudo tee >/dev/null % -"terminal exit -tnoremap -"nohl -nnoremap , :nohlsearch - -colorscheme tokyonight -let g:lightline = {'colorscheme': 'tokyonight'} - -"cursor saving -autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif - -"nerdtree -"show hidden files -let NERDTreeShowHidden=1 -"open on vim open -"autocmd vimenter * NERDTree -"switch to editing window -"autocmd vimenter * wincmd p -"close if only nerdtree is left -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif -"show/hide nerdtree -nnoremap :NERDTreeToggle diff --git a/darwin.nix b/darwin.nix deleted file mode 100644 index 8b24fcb..0000000 --- a/darwin.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ system ? builtins.currentSystem -, nixpkgs ? ./nixpkgs.nix -, pkgs ? import nixpkgs { inherit system; } -, lib ? pkgs.lib -, ... -}@args: -import (import ./default.nix).inputs.darwin args diff --git a/darwin/bootstrap.nix b/darwin/bootstrap.nix index 4bc4f17..5664a49 100644 --- a/darwin/bootstrap.nix +++ b/darwin/bootstrap.nix @@ -2,36 +2,40 @@ { # Nix configuration ------------------------------------------------------------------------------ - nix.settings.trusted-substituters = [ - "https://cache.nixos.org/" - "https://hydra.iohk.io" - "https://cache.iog.io" - "https://nix-community.cachix.org" - "https://mat.cachix.org" - ]; - nix.settings.trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno=" - ]; - nix.settings.trusted-users = [ - "@admin" - ]; + nix.settings = { + trusted-substituters = [ + "https://cache.nixos.org/" + "https://hydra.iohk.io" + "https://cache.iog.io" + "https://nix-community.cachix.org" + "https://mat.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno=" + ]; + trusted-users = [ + "@admin" + ]; + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" ]; + extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [ "x86_64-darwin" "aarch64-darwin" ]; + }; nix.configureBuildUsers = true; - # Enable experimental nix command and flakes - nix.extraOptions = '' - auto-optimise-store = true - experimental-features = nix-command flakes - '' + lib.optionalString (pkgs.system == "aarch64-darwin") '' - extra-platforms = x86_64-darwin aarch64-darwin - ''; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; # Make Fish the default shell + environment.shells = with pkgs; [ + bashInteractive + fish + zsh + ]; + programs.fish.enable = true; programs.fish.useBabelfish = true; programs.fish.babelfishPackage = pkgs.babelfish; diff --git a/darwin/dark-mode-notify-service.nix b/darwin/dark-mode-notify-service.nix new file mode 100644 index 0000000..04b2c1d --- /dev/null +++ b/darwin/dark-mode-notify-service.nix @@ -0,0 +1,21 @@ +{ + # dark-mode-notify configuration + # {{{ + launchd.enable = true; + launchd.agents.dark-mode-notify = { + enable = true; + config = { + Label = "ke.bou.dark-mode-notify"; + KeepAlive = true; + StandardErrorPath = null; + StandardOutPath = null; + ProgramArguments = [ + "${pkgs.dark-mode-notify}/bin/dark-mode-notify" + "${pkgs.fish}/bin/fish" + "-c" + "set-background-to-env DARKMODE" + ]; + }; + }; + # }}} +} diff --git a/darwin/macos-defaults.nix b/darwin/defaults.nix similarity index 87% rename from darwin/macos-defaults.nix rename to darwin/defaults.nix index 07de7d4..ee39970 100644 --- a/darwin/macos-defaults.nix +++ b/darwin/defaults.nix @@ -2,10 +2,7 @@ { system.defaults.NSGlobalDomain = { - # "com.apple.trackpad.scaling" = "3.0"; - # AppleInterfaceStyleSwitchesAutomatically = false; - # InitialKeyRepeat = 15; - # KeyRepeat = 2; + AppleInterfaceStyleSwitchesAutomatically = true; NSAutomaticCapitalizationEnabled = false; _HIHideMenuBar = false; }; diff --git a/darwin/default.nix b/darwin/general.nix similarity index 72% rename from darwin/default.nix rename to darwin/general.nix index c02e978..a33ff99 100644 --- a/darwin/default.nix +++ b/darwin/general.nix @@ -1,30 +1,13 @@ { config, pkgs, lib, ... }: { - imports = [ - ./bootstrap.nix - ./homebrew.nix - ./macos-defaults.nix - ]; - # Apps # `home-manager` currently has issues adding them to `~/Applications` # Issue: https://github.com/nix-community/home-manager/issues/1341 # See workaround at ../home/copyApplications.nix environment.systemPackages = with pkgs; [ - discord-ptb - element-desktop - # firefox * kitty - lagrange - # mullvad-vpn * - obsidian - # signal-desktop * - slack - # steam * terminal-notifier - # zoom-us * - # *no nixpkgs darwin support T.T ]; # https://github.com/nix-community/home-manager/issues/423 @@ -33,11 +16,6 @@ }; programs.nix-index.enable = true; - environment.shells = with pkgs; [ - bashInteractive - fish - zsh - ]; # Fonts fonts.fontDir.enable = true; fonts.fonts = with pkgs; [ diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index c908824..9617df0 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -61,17 +61,22 @@ in "alfred" "bartender" # "cursorcerer" + "discord" + "element" "firefox" "jitsi-meet" "knockknock" + "lagrange" "logitech-options" "lulu" "macsvg" "miniforge" # "mullvadvpn" + "obsidian" "rectangle" "secretive" "signal" + "slack" "stay" "transmission" # "twitch" @@ -87,7 +92,7 @@ in # Configuration related to casks environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive" - "/Users/${config.users.primaryUser}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; + "/Users/${config.users.primaryUser.username}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; # For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be # installed in `../home/default.nix` whenever possible. diff --git a/flake.nix b/flake.nix index 25f31c8..3739a59 100644 --- a/flake.nix +++ b/flake.nix @@ -59,43 +59,44 @@ attrValues genAttrs makeOverridable - optional - optionalAttrs - singleton; + optionalAttrs; # Configuration for `nixpkgs` nixpkgsConfig = { config = { allowUnfree = true; }; - overlays = attrValues self.overlays ++ singleton ( - final: prev: - let - pkgs = import ./pkgs { - inherit inputs genAttrs; - inherit (final) callPackage; - inherit (final.stdenv) system; - }; - in - pkgs // optionalAttrs (prev.stdenv.system == "aarch64-darwin") - { - # Sub in x86 version of packages that don't build on Apple Silicon yet - inherit (final.pkgs-x86); - } - ); + overlays = attrValues self.overlays ++ [ + (final: prev: + import ./pkgs { + inherit inputs genAttrs; + inherit (final) callPackage; + inherit (final.stdenv) system; + }) + (final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") + { + # Sub in x86 version of packages that don't build on Apple Silicon yet + inherit (final.pkgs-x86); + }) + ]; }; - # Shared home-manager configs homeManagerStateVersion = "22.05"; - homeManagerCommonConfig = { - imports = attrValues self.homeManagerModules ++ [ - ./home - { home.stateVersion = homeManagerStateVersion; } - ]; + + primaryUserInfo = { + username = "mat"; + fullName = "mat ess"; + email = "mat@mat.services"; + nixConfigDirectory = "/Users/mat/dotfiles.nix"; + }; + + workUserInfo = { + username = "mess"; + fullName = "Matthew Ess"; + email = "mess@yelp.com"; + nixConfigDirectory = "/Users/mess/dotfiles.nix"; }; # Modules shared by most `nix-darwin` personal configurations. nixDarwinCommonModules = attrValues self.darwinModules ++ [ - # Main `nix-darwin` config - ./darwin # `home-manager` module home-manager.darwinModules.home-manager ( @@ -105,15 +106,20 @@ in { nixpkgs = nixpkgsConfig; - # Hack to support legacy worklows that use `` etc. + # Hack to support legacy worklows that use ``, darwin-option, etc. nix.nixPath = { - nixpkgs = "$HOME/dotfiles.nix/nixpkgs.nix"; - darwin = "$HOME/dotfiles.nix/darwin.nix"; + nixpkgs = "${inputs.nixpkgs-unstable}"; + darwin = "${inputs.darwin}"; }; # `home-manager` config - users.users.${primaryUser}.home = "/Users/${primaryUser}"; + users.users.${primaryUser.username}.home = "/Users/${primaryUser.username}"; home-manager.useGlobalPkgs = true; - home-manager.users.${primaryUser} = homeManagerCommonConfig; + home-manager.users.${primaryUser.username} = { + imports = attrValues self.homeManagerModules; + home.stateVersion = homeManagerStateVersion; + home.primaryUser = primaryUser; + home.enableNixpkgsReleaseCheck = true; + }; # Add a registry entry for this flake nix.registry.my.flake = self; } @@ -135,7 +141,7 @@ system = "aarch64-darwin"; modules = nixDarwinCommonModules ++ [ ({ pkgs, ... }: { - users.primaryUser = "mat"; + users.primaryUser = primaryUserInfo; networking.computerName = "matbook pro m1"; networking.hostName = "matbook"; networking.knownNetworkServices = [ @@ -153,8 +159,6 @@ programs.fish.shellAliases = { code = "${pkgs.vscodium}/bin/codium"; }; - programs.git.userEmail = "mat@mat.services"; - programs.git.userName = "mat ess"; programs.ssh.matchBlocks.remarkable = { hostname = "10.11.99.1"; user = "root"; @@ -170,7 +174,7 @@ system = "aarch64-darwin"; modules = nixDarwinCommonModules ++ [ ({ pkgs, ... }: { - users.primaryUser = "mess"; + users.primaryUser = workUserInfo; networking.knownNetworkServices = [ "Wi-Fi" ]; @@ -184,8 +188,6 @@ ]; homebrew.casks = [ "itsycal" ]; home-manager.sharedModules = [{ - programs.git.userEmail = "mess@yelp.com"; - programs.git.userName = "Matthew Ess"; programs.ssh.matchBlocks.devbox = { hostname = "amp1"; forwardAgent = true; @@ -204,22 +206,35 @@ system = "x86_64-darwin"; modules = nixDarwinCommonModules ++ [ ({ lib, ... }: { - users.primaryUser = "runner"; + users.primaryUser = primaryUserInfo // { + username = "runner"; + nixConfigDirectory = "/Users/runner/work/nixpkgs/nixpkgs"; + }; homebrew.enable = lib.mkForce false; }) ]; }; - # Build and activate with `nix build .#cloudVM.activationPackage; ./result/activate` + }; + + # Build and activate on new system with: + # `nix build .#homeConfigurations..activationPackage; ./result/activate` + homeConfigurations = rec { cloudVM = home-manager.lib.homeManagerConfiguration { - system = "x86_64-linux"; - stateVersion = homeManagerStateVersion; - homeDirectory = "/home/mat"; - username = "mat"; - configuration = { - imports = [ homeManagerCommonConfig ]; - nixpkgs = nixpkgsConfig; + pkgs = import inputs.nixpkgs-unstable { + system = "x86_64-linux"; + inherit (nixpkgsConfig) config overlays; }; + modules = attrValues self.homeManagerModules ++ [ + ({ config, ... }: { + home.username = config.home.primaryUser.username; + home.homeDirectory = "/home/${config.home.username}"; + home.stateVersion = homeManagerStateVersion; + home.primaryUser = primaryUserInfo // { + nixConfigDirectory = "${config.home.homeDirectory}/dotfiles.nix"; + }; + }) + ]; }; }; @@ -270,21 +285,38 @@ }; }; - # `nix-darwin` modules (some are pending upstream acceptance) + # `nix-darwin` configs and modules darwinModules = { + # configs + bootstrap = import ./darwin/bootstrap.nix; + defaults = import ./darwin/defaults.nix; + general = import ./darwin/general.nix; + homebrew = import ./darwin/homebrew.nix; + # modules games = import ./modules/darwin/games.nix; - programs-nix-index = import ./modules/darwin/programs/nix-index.nix; security-pam = import ./modules/darwin/security/pam.nix; - users = import ./modules/darwin/users.nix; + primary-user = import ./modules/darwin/primary-user.nix; }; # home manager configurations homeManagerModules = { - # configs-git-aliases = import ./home/configs/git-aliases.nix; - # configs-gh-aliases = import ./home/configs/gh-aliases.nix; + # configs configs-starship-symbols = import ./home/configs/starship-symbols.nix; + copyApplications = import ./home/copyApplications.nix; + files = import ./home/files.nix; + fish = import ./home/fish.nix; + git = import ./home/git.nix; + kakoune = import ./home/kakoune.nix; + kitty = import ./home/kitty.nix; + programs = import ./home/programs.nix; + starship = import ./home/starship.nix; + # modules programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; + home-primary-user = { lib, ... }: { + options.home.primaryUser = + (self.darwinModules.primary-user { inherit lib; }).options.users.primaryUser; + }; }; } // flake-utils.lib.eachDefaultSystem (system: { diff --git a/home/files.nix b/home/files.nix new file mode 100644 index 0000000..ab30d59 --- /dev/null +++ b/home/files.nix @@ -0,0 +1,15 @@ +{ config, ... }: { + # Misc configuration files --------------------------------------------------------------------{{{ + + xdg = { + enable = true; + }; + + home.file.".pijulconfig".text = '' + [author] + name = "mat" + full_name = "${config.programs.git.userName}" + email = "${config.programs.git.userEmail}" + ''; + # }}} +} diff --git a/home/shells.nix b/home/fish.nix similarity index 84% rename from home/shells.nix rename to home/fish.nix index 92d01d0..4b06049 100644 --- a/home/shells.nix +++ b/home/fish.nix @@ -162,6 +162,10 @@ from-nix kak $file ''; }; + + fish_command_not_found.body = '' + command_not_found_handle $argv + ''; }; # }}} @@ -181,8 +185,8 @@ drsf = "from-nix darwin-rebuild switch --flake ."; # darwin-rebuild switch (no homebrew) drs = "from-nix darwin-rebuild switch --flake . --override-input homebrew-enabled github:boolean-option/false"; - # edit darwin-rebuild config in codium - drc = "codium ${nixConfigDir}"; + # edit darwin-rebuild config in code/codium + drc = "code ${nixConfigDir}"; # edit darwin-rebuild config in vim drv = "vim ${nixConfigDir}"; # edit darwin-rebuild config in kakoune @@ -199,7 +203,7 @@ # Other ".." = "cd .."; ":q" = "exit"; - cat = "${bat}/bin/bat"; + cat = "${bat}/bin/bat --style=plain"; du = "${du-dust}/bin/dust"; g = "${gitAndTools.git}/bin/git"; ls = "${exa}/bin/exa"; @@ -210,6 +214,7 @@ top = "${bottom}/bin/btm"; htop = "${bottom}/bin/btm"; tb = "toggle-background"; + } // lib.optionalAttrs stdenv.isDarwin { sb = "set-background-to-macOS"; conda-init = "eval /opt/homebrew/Caskroom/miniforge/base/bin/conda 'shell.fish' 'hook' $argv | source"; }; @@ -234,45 +239,4 @@ init-shell-colors ''; # }}} - - # Starship Prompt - # https://rycee.gitlab.io/home-manager/options.html#opt-programs.starship.enable - programs.starship.enable = true; - - # Starship settings -------------------------------------------------------------------------- {{{ - - programs.starship.settings = { - # See docs here: https://starship.rs/config/ - # Symbols config configured in Flake. - - battery.display = [ - { threshold = 25; } # display battery information if charge is <= 25% - ]; - directory.fish_style_pwd_dir_length = 1; # turn on fish directory truncation - directory.truncation_length = 2; # number of directories not to truncate - # hostname.style = "bold green"; # don't like the default - memory_usage.disabled = true; # because it includes cached memory it's reported as full a lot - # username.style_user = "bold blue"; # don't like the default - }; - # }}} - - # dark-mode-notify configuration - # {{{ - launchd.enable = true; - launchd.agents.dark-mode-notify = { - enable = true; - config = { - Label = "ke.bou.dark-mode-notify"; - KeepAlive = true; - StandardErrorPath = null; - StandardOutPath = null; - ProgramArguments = [ - "${pkgs.dark-mode-notify}/bin/dark-mode-notify" - "${pkgs.fish}/bin/fish" - "-c" - "set-background-to-env DARKMODE" - ]; - }; - }; - # }}} } diff --git a/home/git.nix b/home/git.nix index df26b1c..633394e 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { # Git @@ -6,6 +6,9 @@ # Aliases config imported in flake. programs.git.enable = true; + programs.git.userEmail = config.home.primaryUser.email; + programs.git.userName = config.home.primaryUser.fullName; + programs.git.extraConfig = { core.editor = "kak"; diff.colorMoved = "default"; diff --git a/home/default.nix b/home/programs.nix similarity index 75% rename from home/default.nix rename to home/programs.nix index be68803..b242feb 100644 --- a/home/default.nix +++ b/home/programs.nix @@ -1,18 +1,7 @@ { config, pkgs, lib, ... }: { - # Import config broken out into files - imports = [ - ./copyApplications.nix - ./git.nix - ./kakoune.nix - ./kitty.nix - ./shells.nix - ]; - - home.enableNixpkgsReleaseCheck = true; - - # Packages with configuration --------------------------------------------------------------- {{{ + # Programs + packages with configuration --------------------------------------------------------------- {{{ programs = { # a nicer cat @@ -20,7 +9,7 @@ bat = { enable = true; config = { - style = "plain"; + style = "auto"; }; }; # Direnv, load and unload environment variables depending on the current directory. @@ -52,24 +41,12 @@ helix = { enable = true; }; - neovim = { - enable = true; - # viAlias = true; - # vimAlias = true; - # vimdiffAlias = true; - extraConfig = builtins.readFile ../configs/init.vim; - plugins = with pkgs.vimPlugins; [ - neovim-sensible - tokyonight-nvim - lightline-vim - ctrlp - ]; - }; ssh = { enable = true; matchBlocks."*".extraOptions = { UseKeychain = "yes"; AddKeysToAgent = "yes"; + } // lib.optionalAttrs pkgs.stdenv.isDarwin { # TODO: gate this behind a check if the cask is present IdentityAgent = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; }; @@ -125,18 +102,4 @@ is-dark-mode # see /overlays/colors.nix ]; # }}} - - # Misc configuration files --------------------------------------------------------------------{{{ - - xdg = { - enable = true; - }; - - home.file.".pijulconfig".text = '' - [author] - name = "mat" - full_name = "${config.programs.git.userName}" - email = "${config.programs.git.userEmail}" - ''; - # }}} } diff --git a/home/starship.nix b/home/starship.nix new file mode 100644 index 0000000..86c672f --- /dev/null +++ b/home/starship.nix @@ -0,0 +1,22 @@ +{ + # Starship Prompt + # https://rycee.gitlab.io/home-manager/options.html#opt-programs.starship.enable + programs.starship.enable = true; + + # Starship settings -------------------------------------------------------------------------- {{{ + + programs.starship.settings = { + # See docs here: https://starship.rs/config/ + # Symbols config configured in Flake. + + battery.display = [ + { threshold = 25; } # display battery information if charge is <= 25% + ]; + directory.fish_style_pwd_dir_length = 1; # turn on fish directory truncation + directory.truncation_length = 2; # number of directories not to truncate + # hostname.style = "bold green"; # don't like the default + memory_usage.disabled = true; # because it includes cached memory it's reported as full a lot + # username.style_user = "bold blue"; # don't like the default + }; + # }}} +} diff --git a/modules/darwin/primary-user.nix b/modules/darwin/primary-user.nix new file mode 100644 index 0000000..9ff8ff3 --- /dev/null +++ b/modules/darwin/primary-user.nix @@ -0,0 +1,26 @@ +{ lib, ... }: + +let + inherit (lib) mkOption types; +in + +{ + options.users.primaryUser = { + username = mkOption { + type = with types; nullOr string; + default = null; + }; + fullName = mkOption { + type = with types; nullOr string; + default = null; + }; + email = mkOption { + type = with types; nullOr string; + default = null; + }; + nixConfigDirectory = mkOption { + type = with types; nullOr string; + default = null; + }; + }; +} diff --git a/modules/darwin/programs/nix-index.nix b/modules/darwin/programs/nix-index.nix deleted file mode 100644 index e6d3ae8..0000000 --- a/modules/darwin/programs/nix-index.nix +++ /dev/null @@ -1,17 +0,0 @@ -# Additional configuration for `nix-index` to enable `command-not-found` functionality with Fish. -{ config, lib, pkgs, ... }: - -{ - config = lib.mkIf config.programs.nix-index.enable { - programs.fish.interactiveShellInit = '' - function __fish_command_not_found_handler --on-event="fish_command_not_found" - ${if config.programs.fish.useBabelfish then '' - command_not_found_handle $argv - '' else '' - ${pkgs.bashInteractive}/bin/bash -c \ - "source ${config.progams.nix-index.package}/etc/profile.d/command-not-found.sh; command_not_found_handle $argv" - ''} - end - ''; - }; -} diff --git a/modules/darwin/users.nix b/modules/darwin/users.nix deleted file mode 100644 index 322067e..0000000 --- a/modules/darwin/users.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib, ... }: - -let - inherit (lib) mkOption types; -in - -{ - options = { - users.primaryUser = mkOption { - type = with types; nullOr string; - default = null; - }; - }; -} diff --git a/nixpkgs.nix b/nixpkgs.nix deleted file mode 100644 index d2c457b..0000000 --- a/nixpkgs.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ system ? builtins.currentSystem -, config ? { } -, overlays ? [ ] -, ... -}@args: -import (import ./default.nix).inputs.nixpkgs-unstable args