diff --git a/flake.nix b/flake.nix index f9c24d9..cfc6764 100644 --- a/flake.nix +++ b/flake.nix @@ -49,54 +49,53 @@ }; }; - outputs = - inputs@{ - self, - nixpkgs, - darwin, - home-manager, - nvf, - sops-nix, - nix-homebrew, - homebrew-core, - homebrew-cask, - ... - }: - let - system = "aarch64-darwin"; - username = "poby"; - useremail = "smg981024@gmail.com"; - hostname = "fenrir"; # TODO break down to multiple hosts + outputs = inputs @ { + self, + nixpkgs, + darwin, + home-manager, + nvf, + sops-nix, + nix-homebrew, + homebrew-core, + homebrew-cask, + ... + }: let + system = "aarch64-darwin"; + username = "poby"; + useremail = "smg981024@gmail.com"; + hostname = "fenrir"; # TODO break down to multiple hosts - specialArgs = inputs // { + specialArgs = + inputs + // { inherit username useremail hostname; }; - in - { - darwinConfigurations."${hostname}" = darwin.lib.darwinSystem { - inherit system specialArgs; - modules = [ - ./modules/nix-core.nix - ./modules/system.nix - ./modules/apps.nix - ./modules/host-users.nix - nix-homebrew.darwinModules.nix-homebrew - home-manager.darwinModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - extraSpecialArgs = specialArgs; - sharedModules = [ - nvf.homeManagerModules.nvf - sops-nix.homeManagerModules.sops - ]; - users.${username} = import ./home; - }; - } - ]; - }; - formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; + in { + darwinConfigurations."${hostname}" = darwin.lib.darwinSystem { + inherit system specialArgs; + modules = [ + ./modules/nix-core.nix + ./modules/system.nix + ./modules/apps.nix + ./modules/host-users.nix + nix-homebrew.darwinModules.nix-homebrew + home-manager.darwinModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + extraSpecialArgs = specialArgs; + sharedModules = [ + nvf.homeManagerModules.nvf + sops-nix.homeManagerModules.sops + ]; + users.${username} = import ./home; + }; + } + ]; }; + formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; + }; } diff --git a/home/aerospace.nix b/home/aerospace.nix index 6f48864..b5c37f3 100644 --- a/home/aerospace.nix +++ b/home/aerospace.nix @@ -6,7 +6,7 @@ accordion-padding = 10; default-root-container-layout = "tiles"; default-root-container-orientation = "auto"; - on-focused-monitor-changed = [ "move-mouse monitor-lazy-center" ]; + on-focused-monitor-changed = ["move-mouse monitor-lazy-center"]; automatically-unhide-macos-hidden-apps = false; # persistent-workspaces = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" ]; diff --git a/home/default.nix b/home/default.nix index 1e869ec..8ae1be7 100755 --- a/home/default.nix +++ b/home/default.nix @@ -2,8 +2,7 @@ pkgs, username, ... -}: -{ +}: { imports = [ ./fd.nix ./fzf.nix diff --git a/home/fd.nix b/home/fd.nix index dd938e4..79dadf7 100755 --- a/home/fd.nix +++ b/home/fd.nix @@ -1,7 +1,7 @@ { programs.fd = { enable = true; - ignores = [ ".git/" ]; + ignores = [".git/"]; hidden = true; }; } diff --git a/home/mise.nix b/home/mise.nix index 5faacfa..d5fa8ce 100644 --- a/home/mise.nix +++ b/home/mise.nix @@ -6,6 +6,7 @@ tools = { node = "lts"; uv = "latest"; + python = "3.13"; }; settings = { experimental = true; diff --git a/home/nvf/core/autocmds.nix b/home/nvf/core/autocmds.nix index 2bdba3c..ff9fdda 100755 --- a/home/nvf/core/autocmds.nix +++ b/home/nvf/core/autocmds.nix @@ -1,9 +1,8 @@ -{ lib, ... }: -[ +{lib, ...}: [ # autocmds { enable = true; - event = [ "BufReadPost" ]; + event = ["BufReadPost"]; desc = "Return to last cursor position"; group = "LastCursorGroup"; callback = lib.generators.mkLuaInline '' @@ -18,10 +17,10 @@ } { enable = true; - event = [ "TextYankPost" ]; + event = ["TextYankPost"]; desc = "Highlight yanks on copy"; group = "HighlightYank"; - pattern = [ "*" ]; + pattern = ["*"]; callback = lib.generators.mkLuaInline '' function() vim.hl.on_yank({ diff --git a/home/nvf/core/spellcheck.nix b/home/nvf/core/spellcheck.nix index ff77048..4966b3c 100755 --- a/home/nvf/core/spellcheck.nix +++ b/home/nvf/core/spellcheck.nix @@ -1,5 +1,5 @@ { # spellcheck enable = true; - languages = [ "en" ]; + languages = ["en"]; } diff --git a/home/nvf/default.nix b/home/nvf/default.nix index 05bc14b..43292a8 100755 --- a/home/nvf/default.nix +++ b/home/nvf/default.nix @@ -2,10 +2,9 @@ lib, pkgs, ... -}: -let +}: let options = import ./core/options.nix; - autocmds = import ./core/autocmds.nix { inherit lib; }; + autocmds = import ./core/autocmds.nix {inherit lib;}; augroups = import ./core/augroups.nix; keymaps = import ./core/keymaps.nix; fzf-lua = import ./plugins/fzf-lua.nix; @@ -15,11 +14,10 @@ let terminal = import ./plugins/terminal.nix; theme = import ./appearance/theme.nix; lsp = import ./lsp/lsp.nix; - treesitter = import ./lsp/treesitter.nix { inherit pkgs; }; + treesitter = import ./lsp/treesitter.nix {inherit pkgs;}; autocomplete = import ./lsp/autocomplete.nix; languages = import ./lsp/languages; -in -{ +in { programs.nvf = { enable = true; diff --git a/home/nvf/lsp/languages/bash.nix b/home/nvf/lsp/languages/bash.nix index 8ace9c5..2205f03 100755 --- a/home/nvf/lsp/languages/bash.nix +++ b/home/nvf/lsp/languages/bash.nix @@ -3,15 +3,15 @@ enable = true; extraDiagnostics = { enable = true; - types = [ "shellcheck" ]; + types = ["shellcheck"]; }; format = { enable = true; - type = [ "shfmt" ]; + type = ["shfmt"]; }; lsp = { enable = true; - servers = [ "bash-ls" ]; + servers = ["bash-ls"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/languages/default.nix b/home/nvf/lsp/languages/default.nix index cb73cc3..b67cb8b 100755 --- a/home/nvf/lsp/languages/default.nix +++ b/home/nvf/lsp/languages/default.nix @@ -6,8 +6,7 @@ let markdown = import ./markdown.nix; html = import ./html.nix; yaml = import ./yaml.nix; -in -{ +in { inherit nix python diff --git a/home/nvf/lsp/languages/html.nix b/home/nvf/lsp/languages/html.nix index 7f31f2c..c0d3a7b 100755 --- a/home/nvf/lsp/languages/html.nix +++ b/home/nvf/lsp/languages/html.nix @@ -3,7 +3,7 @@ enable = true; extraDiagnostics = { enable = true; - types = [ "htmlhint" ]; + types = ["htmlhint"]; }; format = { enable = true; @@ -14,7 +14,7 @@ }; lsp = { enable = true; - servers = [ "superhtml" ]; + servers = ["superhtml"]; }; treesitter = { enable = true; diff --git a/home/nvf/lsp/languages/lua.nix b/home/nvf/lsp/languages/lua.nix index 1947b1b..57c7de0 100755 --- a/home/nvf/lsp/languages/lua.nix +++ b/home/nvf/lsp/languages/lua.nix @@ -3,15 +3,15 @@ enable = true; extraDiagnostics = { enable = true; - types = [ "luacheck" ]; + types = ["luacheck"]; }; format = { enable = true; - type = [ "stylua" ]; + type = ["stylua"]; }; lsp = { enable = true; - servers = [ "lua-language-server" ]; + servers = ["lua-language-server"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/languages/markdown.nix b/home/nvf/lsp/languages/markdown.nix index ca1ee03..958bfff 100755 --- a/home/nvf/lsp/languages/markdown.nix +++ b/home/nvf/lsp/languages/markdown.nix @@ -13,7 +13,7 @@ }; extraDiagnostics = { enable = true; - types = [ "markdownlint-cli2" ]; + types = ["markdownlint-cli2"]; }; format = { enable = true; @@ -24,7 +24,7 @@ }; lsp = { enable = true; - servers = [ "marksman" ]; + servers = ["marksman"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/languages/nix.nix b/home/nvf/lsp/languages/nix.nix index c9ea615..e03681a 100755 --- a/home/nvf/lsp/languages/nix.nix +++ b/home/nvf/lsp/languages/nix.nix @@ -10,11 +10,11 @@ }; format = { enable = true; - type = [ "alejandra" ]; + type = ["alejandra"]; }; lsp = { enable = true; - servers = [ "nil" ]; + servers = ["nil"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/languages/python.nix b/home/nvf/lsp/languages/python.nix index 840716b..13bcf1b 100755 --- a/home/nvf/lsp/languages/python.nix +++ b/home/nvf/lsp/languages/python.nix @@ -3,11 +3,11 @@ enable = true; format = { enable = true; - type = [ "ruff" ]; + type = ["ruff"]; }; lsp = { enable = true; - servers = [ "pyright" ]; + servers = ["pyright"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/languages/yaml.nix b/home/nvf/lsp/languages/yaml.nix index 35f914e..43fb599 100755 --- a/home/nvf/lsp/languages/yaml.nix +++ b/home/nvf/lsp/languages/yaml.nix @@ -3,7 +3,7 @@ enable = true; lsp = { enable = true; - servers = [ "yaml-language-server" ]; + servers = ["yaml-language-server"]; }; treesitter.enable = true; } diff --git a/home/nvf/lsp/treesitter.nix b/home/nvf/lsp/treesitter.nix index c831cf8..da824a3 100755 --- a/home/nvf/lsp/treesitter.nix +++ b/home/nvf/lsp/treesitter.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { # treesitter enable = true; addDefaultGrammars = true; diff --git a/home/nvf/plugins/fzf-lua.nix b/home/nvf/plugins/fzf-lua.nix index d6ff206..f463c4a 100755 --- a/home/nvf/plugins/fzf-lua.nix +++ b/home/nvf/plugins/fzf-lua.nix @@ -2,5 +2,5 @@ # fzf-lua enable = true; profile = "default"; - setupOpts = { }; + setupOpts = {}; } diff --git a/home/sops.nix b/home/sops.nix index d8a932b..c8b52cf 100644 --- a/home/sops.nix +++ b/home/sops.nix @@ -1,13 +1,12 @@ -{ config, ... }: -{ +{config, ...}: { sops = { age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; defaultSopsFile = ../secrets/poby.yaml; secrets = { - "github_ssh_key" = { }; - "github_cli_token" = { }; + "github_ssh_key" = {}; + "github_cli_token" = {}; }; }; } diff --git a/home/ssh.nix b/home/ssh.nix index 142acae..378be6e 100644 --- a/home/ssh.nix +++ b/home/ssh.nix @@ -1,15 +1,14 @@ -{ config, ... }: -{ +{config, ...}: { programs.ssh = { enable = true; enableDefaultConfig = false; matchBlocks = { - "*" = { }; + "*" = {}; "github.com" = { host = "github.com"; user = "git"; identitiesOnly = true; - identityFile = [ config.sops.secrets."github_ssh_key".path ]; + identityFile = [config.sops.secrets."github_ssh_key".path]; }; }; }; diff --git a/home/starship.nix b/home/starship.nix index 9af15a1..2d50ffc 100755 --- a/home/starship.nix +++ b/home/starship.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{lib, ...}: { programs.starship = { enable = true; enableZshIntegration = true; @@ -163,8 +162,8 @@ "package-lock.json" "yarn.lock" ]; - detect_folders = [ "node_modules" ]; - detect_extensions = [ ]; + detect_folders = ["node_modules"]; + detect_extensions = []; }; python = { diff --git a/home/zoxide.nix b/home/zoxide.nix index 2e51d3c..ac54e8f 100755 --- a/home/zoxide.nix +++ b/home/zoxide.nix @@ -3,6 +3,6 @@ enable = true; enableZshIntegration = true; enableBashIntegration = true; - options = [ "--cmd j" ]; + options = ["--cmd j"]; }; } diff --git a/home/zsh.nix b/home/zsh.nix index 7c0916f..2a5dc0a 100755 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{config, ...}: { programs.zsh = { enable = true; @@ -21,7 +20,7 @@ shellAliases = { poby = "echo my name is poby"; nixconfig = "cd ~/nix-darwin && vim flake.nix"; - just-darwin = "cd ~/nix-darwin && just darwin"; + just-darwin = "cd ~/nix-darwin && just darwin $(hostname)"; }; sessionVariables = { diff --git a/modules/apps.nix b/modules/apps.nix index 60af7b0..29553b0 100644 --- a/modules/apps.nix +++ b/modules/apps.nix @@ -5,8 +5,7 @@ homebrew-core, homebrew-cask, ... -}: -{ +}: { nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ diff --git a/modules/host-users.nix b/modules/host-users.nix index 5192d36..9df535e 100644 --- a/modules/host-users.nix +++ b/modules/host-users.nix @@ -2,8 +2,7 @@ username, hostname, ... -}: -{ +}: { networking = { hostName = hostname; computerName = hostname; @@ -15,5 +14,5 @@ description = username; }; - nix.settings.trusted-users = [ username ]; + nix.settings.trusted-users = [username]; } diff --git a/modules/nix-core.nix b/modules/nix-core.nix index c4da2d3..cee556b 100644 --- a/modules/nix-core.nix +++ b/modules/nix-core.nix @@ -2,8 +2,7 @@ pkgs, lib, ... -}: -{ +}: { nix = { enable = true; package = pkgs.nix; @@ -13,7 +12,7 @@ "nix-command" "flakes" ]; - substituters = [ "https://nix-community.cachix.org" ]; + substituters = ["https://nix-community.cachix.org"]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; diff --git a/modules/system.nix b/modules/system.nix index 267234a..3936253 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -4,8 +4,7 @@ username, hostname, ... -}: -{ +}: { time.timeZone = "Asia/Seoul"; system = { @@ -19,14 +18,13 @@ sudo -u ${username} /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u ''; - activationScripts.applications.text = - let - env = pkgs.buildEnv { - name = "system-applications"; - paths = config.environment.systemPackages; - pathsToLink = [ "/Applications" ]; - }; - in + activationScripts.applications.text = let + env = pkgs.buildEnv { + name = "system-applications"; + paths = config.environment.systemPackages; + pathsToLink = ["/Applications"]; + }; + in pkgs.lib.mkForce '' # Set up applications. echo "setting up /Applications..." >&2