From 1642de788ccac8098d944066184a0c71b7a8e537 Mon Sep 17 00:00:00 2001 From: sefidel Date: Fri, 2 Jun 2023 22:11:08 +0900 Subject: fix(darwin/kompakt-darwin): fixup --- darwin/default.nix | 4 +- darwin/kompakt-darwin/configuration.nix | 66 +++++++++++++++++++++++ darwin/kompakt/configuration.nix | 66 ----------------------- flake.lock | 96 ++++++++++++++++----------------- home/default.nix | 21 ++++++++ home/kompakt-darwin/sefidel.nix | 9 ++++ home/profiles/base-darwin/default.nix | 1 + home/profiles/browsing/default.nix | 5 +- home/profiles/communication/default.nix | 6 ++- 9 files changed, 154 insertions(+), 120 deletions(-) create mode 100644 darwin/kompakt-darwin/configuration.nix delete mode 100644 darwin/kompakt/configuration.nix create mode 100644 home/kompakt-darwin/sefidel.nix diff --git a/darwin/default.nix b/darwin/default.nix index 3144894..5ab7fb7 100644 --- a/darwin/default.nix +++ b/darwin/default.nix @@ -1,8 +1,8 @@ { self, darwin, unstable, ... } @ inputs: { - kompakt = self.lib.mkDarwin { - name = "kompakt"; + kompakt-darwin = self.lib.mkDarwin { + name = "kompakt-darwin"; system = "aarch64-darwin"; nixpkgs = unstable; }; diff --git a/darwin/kompakt-darwin/configuration.nix b/darwin/kompakt-darwin/configuration.nix new file mode 100644 index 0000000..7080e77 --- /dev/null +++ b/darwin/kompakt-darwin/configuration.nix @@ -0,0 +1,66 @@ +{ config, pkgs, lib, ... }: + +{ + nix = { + settings.substituters = [ + "https://cache.nixos.org/" + ]; + settings.trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + + settings.trusted-users = [ + "@admin" + ]; + + settings.auto-optimise-store = lib.mkDefault true; + configureBuildUsers = true; + gc.automatic = lib.mkDefault true; + gc.options = lib.mkDefault "--delete-older-than 10d"; + extraOptions = '' + experimental-features = nix-command flakes + extra-platforms = x86_64-darwin aarch64-darwin + ''; + }; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = + [ + pkgs.vim + ]; + + # Use a custom configuration.nix location. + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix + # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + # nix.package = pkgs.nix; + + users.users.sefidel = { + name = "sefidel"; + home = "/Users/sefidel"; + }; + + # Create /etc/zshrc that loads the nix-darwin environment. + programs.zsh.enable = true; # default shell on catalina + # programs.fish.enable = true; + + # Make applications pop up in finder/spotlight + system.activationScripts.applications.text = pkgs.lib.mkForce ( + '' + echo "setting up ~/Applications..." >&2 + rm -rf ~/Applications/Nix\ Apps + mkdir -p ~/Applications/Nix\ Apps + for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do + src="$(/usr/bin/stat -f%Y "$app")" + cp -r "$src" ~/Applications/Nix\ Apps + done + '' + ); + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; +} diff --git a/darwin/kompakt/configuration.nix b/darwin/kompakt/configuration.nix deleted file mode 100644 index 8507adb..0000000 --- a/darwin/kompakt/configuration.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - nix = { - settings.substituters = [ - "https://cache.nixos.org/" - ]; - settings.trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - ]; - - settings.trusted-users = [ - "@admin" - ]; - - settings.auto-optimise-store = lib.mkDefault true; - configureBuildUsers = true; - gc.automatic = lib.mkDefault true; - gc.options = lib.mkDefault "--delete-older-than 10d"; - extraOptions = '' - experimental-features = nix-command flakes - extra-platforms = x86_64-darwin aarch64-darwin - ''; - }; - - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - environment.systemPackages = - [ - pkgs.vim - ]; - - # Use a custom configuration.nix location. - # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix - # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; - - # Auto upgrade nix package and the daemon service. - services.nix-daemon.enable = true; - # nix.package = pkgs.nix; - - users.users.o32 = { - name = "o32"; - home = "/Users/o32"; - }; - - # Create /etc/zshrc that loads the nix-darwin environment. - programs.zsh.enable = true; # default shell on catalina - # programs.fish.enable = true; - - # Make applications pop up in finder/spotlight - system.activationScripts.applications.text = pkgs.lib.mkForce ( - '' - echo "setting up ~/Applications..." >&2 - rm -rf ~/Applications/Nix\ Apps - mkdir -p ~/Applications/Nix\ Apps - for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do - src="$(/usr/bin/stat -f%Y "$app")" - cp -r "$src" ~/Applications/Nix\ Apps - done - '' - ); - - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 4; -} diff --git a/flake.lock b/flake.lock index 99c8416..202033e 100644 --- a/flake.lock +++ b/flake.lock @@ -44,11 +44,11 @@ ] }, "locked": { - "lastModified": 1682009832, - "narHash": "sha256-QdNOeFE7sI+0ddqVfn9vQDCUs7OdxhJ7evo9sdyP82Y=", + "lastModified": 1673295039, + "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "a1ee4d333b092bc055655fb06229eb3013755812", + "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", "type": "github" }, "original": { @@ -73,15 +73,12 @@ } }, "flake-utils_2": { - "inputs": { - "systems": "systems" - }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -94,14 +91,15 @@ "inputs": { "nixpkgs": [ "unstable" - ] + ], + "utils": "utils" }, "locked": { - "lastModified": 1682072616, - "narHash": "sha256-sR5RL3LACGuq5oePcAoJ/e1S3vitKQQSNACMYmqIE1E=", + "lastModified": 1679684476, + "narHash": "sha256-WTYZFt9cJmOSp1n3hxAS+BQnu7smcBsC98RSgdp2qsE=", "owner": "nix-community", "repo": "home-manager", - "rev": "47d6c3f65234230d37f1cf7d3d6b5575ec80fe0c", + "rev": "db37c537603d1d45d022cc0666ad45197455b364", "type": "github" }, "original": { @@ -134,11 +132,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1682162505, - "narHash": "sha256-2g375xsmV2v/XlCCfiozGjOpxnDF1h+E6FJWf47sjFM=", + "lastModified": 1679707662, + "narHash": "sha256-G256RcY2KUW2BeiPDp60+Nd49Ce7cV/MRqKj/P8svGA=", "owner": "neovim", "repo": "neovim", - "rev": "515106ac08c4159bfdf855ad05c37e04ec4b5ef5", + "rev": "aab4443bb907a0cf7ef874c22f8cfae667b65552", "type": "github" }, "original": { @@ -150,11 +148,11 @@ }, "nixpkgs-2211": { "locked": { - "lastModified": 1681932375, - "narHash": "sha256-tSXbYmpnKSSWpzOrs27ie8X3I0yqKA6AuCzCYNtwbCU=", + "lastModified": 1679611345, + "narHash": "sha256-PCFRkV/kLNqNAKSaleXGH6i9Wv+ba7+1NZKh+15CFiM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3d302c67ab8647327dba84fbdb443cdbf0e82744", + "rev": "a38c914c34f93328ad7fbcdea0801bc11cbd1565", "type": "github" }, "original": { @@ -166,11 +164,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1681613598, - "narHash": "sha256-Ogkoma0ytYcDoMR2N7CZFABPo+i0NNo26dPngru9tPc=", + "lastModified": 1679163677, + "narHash": "sha256-VC0tc3EjJZFPXgucFQAYMIHce5nJWYR0kVCk4TVg6gg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1040ce5f652b586da95dfd80d48a745e107b9eac", + "rev": "c3912035d00ef755ab19394488b41feab95d2e40", "type": "github" }, "original": { @@ -203,11 +201,11 @@ ] }, "locked": { - "lastModified": 1682129965, - "narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=", + "lastModified": 1679710743, + "narHash": "sha256-zB6vEMoOmXZyqD/yNu1DYqtYvQaPERjWEnmhK8ovlWk=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "2c417c0460b788328220120c698630947547ee83", + "rev": "8ba8bdaee0dfb4b7ad8b1f398e4f24d4dee89760", "type": "github" }, "original": { @@ -240,11 +238,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1681821695, - "narHash": "sha256-uwyBGo/9IALi97AfMuzkJroQQhV6hkybaZVdw6pRNG4=", + "lastModified": 1679377997, + "narHash": "sha256-O8rmc/b/qgNgoHj2tL5+3Ovkj7A+Sok7gazRoWbpnqg=", "owner": "Mic92", "repo": "sops-nix", - "rev": "5698b06b0731a2c15ff8c2351644427f8ad33993", + "rev": "d8827a8368c307fbc6ed594c9a31d619e7360bed", "type": "github" }, "original": { @@ -253,28 +251,13 @@ "type": "github" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "unstable": { "locked": { - "lastModified": 1681920287, - "narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=", + "lastModified": 1679437018, + "narHash": "sha256-vOuiDPLHSEo/7NkiWtxpHpHgoXoNmrm+wkXZ6a072Fc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", + "rev": "19cf008bb18e47b6e3b4e16e32a9a4bdd4b45f7e", "type": "github" }, "original": { @@ -286,11 +269,11 @@ }, "unstable-small": { "locked": { - "lastModified": 1682091174, - "narHash": "sha256-L9ZeRYPDY+S02pKxDBomnWvi/tos3aJ/GTonhODIqVc=", + "lastModified": 1679687487, + "narHash": "sha256-EpZbOmViyeEShhit1YRBMAx5PgyzqQaq+I+WV1xP8bA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d67390c8d9c992bb62ff7d6154f002f087e3c2b6", + "rev": "aace3ac619d47f5a9846c37ce1b196f49867cd25", "type": "github" }, "original": { @@ -299,6 +282,21 @@ "repo": "nixpkgs", "type": "github" } + }, + "utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/home/default.nix b/home/default.nix index 9c9e324..b338929 100644 --- a/home/default.nix +++ b/home/default.nix @@ -41,4 +41,25 @@ version = "23.05"; }; + + "sefidel@kompakt-darwin" = self.lib.mkHome { + username = "sefidel"; + hostname = "kompakt-darwin"; + pkgs = import unstable { system = "aarch64-darwin"; overlays = with inputs; [ rust.overlays.default (import ../overlays/neovim.nix) neovim.overlay ]; }; + + extraModules = [ + ./profiles/populate.nix + ./profiles/base-darwin + ./profiles/browsing + ./profiles/development + ./profiles/communication + ./profiles/multimedia + ./profiles/research + ./profiles/fonts + + inputs.sops-nix.homeManagerModules.sops + ]; + + version = "23.05"; + }; } diff --git a/home/kompakt-darwin/sefidel.nix b/home/kompakt-darwin/sefidel.nix new file mode 100644 index 0000000..51c2519 --- /dev/null +++ b/home/kompakt-darwin/sefidel.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + config = { + activeProfiles = [ "base-darwin" "development" "research" "fonts" ]; + + programs.htop.settings.detailed_cpu_time = true; + }; +} diff --git a/home/profiles/base-darwin/default.nix b/home/profiles/base-darwin/default.nix index 332bb2b..2ce67e7 100644 --- a/home/profiles/base-darwin/default.nix +++ b/home/profiles/base-darwin/default.nix @@ -164,6 +164,7 @@ in default-cache-ttl-ssh 3600 pinentry-program ${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac allow-preset-passphrase + enable-ssh-support ''; }; } diff --git a/home/profiles/browsing/default.nix b/home/profiles/browsing/default.nix index ab5470c..b6478a5 100644 --- a/home/profiles/browsing/default.nix +++ b/home/profiles/browsing/default.nix @@ -8,7 +8,10 @@ in }; config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ lynx firefox ]; + home.packages = with pkgs; [ lynx ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) [ + # TODO: currently broken/doesn't support Darwin + pkgs.firefox + ]; programs.qutebrowser = { enable = true; diff --git a/home/profiles/communication/default.nix b/home/profiles/communication/default.nix index 76f73b2..4c46b83 100644 --- a/home/profiles/communication/default.nix +++ b/home/profiles/communication/default.nix @@ -14,7 +14,7 @@ let }); mbsyncCmd = if pkgs.stdenv.isLinux then "${config.programs.mbsync.package}/bin/mbsync" else ""; # https://github.com/Mic92/sops-nix/issues/284 - fixSopsPrefix = x: y: builtins.replaceStrings ["%r"] ["/run/user/${toString x}"] y; + fixSopsPrefix = x: y: builtins.replaceStrings [ "%r" ] [ "/run/user/${toString x}" ] y; in { imports = [ ../../modules/programs/nixpkgs ]; @@ -400,7 +400,6 @@ in slack discord-canary schildichat-desktop-wayland - nheko (weechat.override { configure = { availablePlugins, ... }: { plugins = [ @@ -414,6 +413,9 @@ in ]; }; }) + ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) [ + # TODO: currently broken/doesn't support Darwin + pkgs.nheko ]; nixpkgs.allowedUnfree = [ "slack" "discord-canary" ]; -- cgit 1.4.1