From 1248d431ff09c15df666b381059efb8884718a9b Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 11 Mar 2024 17:26:22 -0700 Subject: switch to absolute path --- hosts/common/homebrew.nix | 42 ------------------------------------------ hosts/common/macos.nix | 23 ----------------------- hosts/common/nix.nix | 24 ------------------------ hosts/mba/default.nix | 13 ------------- hosts/work/default.nix | 13 ------------- nix/flake/hosts.nix | 10 +++++----- nix/hosts/common/homebrew.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ nix/hosts/common/macos.nix | 23 +++++++++++++++++++++++ nix/hosts/common/nix.nix | 24 ++++++++++++++++++++++++ nix/hosts/mba/default.nix | 13 +++++++++++++ nix/hosts/work/default.nix | 13 +++++++++++++ 11 files changed, 120 insertions(+), 120 deletions(-) delete mode 100644 hosts/common/homebrew.nix delete mode 100644 hosts/common/macos.nix delete mode 100644 hosts/common/nix.nix delete mode 100644 hosts/mba/default.nix delete mode 100644 hosts/work/default.nix create mode 100644 nix/hosts/common/homebrew.nix create mode 100644 nix/hosts/common/macos.nix create mode 100644 nix/hosts/common/nix.nix create mode 100644 nix/hosts/mba/default.nix create mode 100644 nix/hosts/work/default.nix diff --git a/hosts/common/homebrew.nix b/hosts/common/homebrew.nix deleted file mode 100644 index b358695..0000000 --- a/hosts/common/homebrew.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ ... }: -{ - # Required for homebrew on aarch64 - environment.systemPath = [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; - - homebrew = { - enable = true; - onActivation.autoUpdate = true; - onActivation.upgrade = true; - - brews = [ - "aspell" # spelling - "envoy" # to do some testing with envoy - "go" # it's also installed by nix, but this is a fallback, just in case - "hashicorp/tap/boundary" # https://www.boundaryproject.io/ - "kind" # to run local k8s cluster - "kubebuilder" - "s3cmd" - ]; - - taps = [ - "homebrew/cask-fonts" - "hashicorp/tap" - ]; - - casks = [ - "1password-cli" - "docker" - "element" - "emacs" - "font-monaspace" # https://github.com/githubnext/monaspace - "font-source-code-pro" - "iterm2" - "netnewswire" - "transmission" - "vlc" - "wireshark" - "zed" - "zoom" - ]; - }; -} diff --git a/hosts/common/macos.nix b/hosts/common/macos.nix deleted file mode 100644 index edc57a0..0000000 --- a/hosts/common/macos.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: { - system.defaults.dock.autohide = true; - system.defaults.dock.orientation = "left"; - system.defaults.dock.showhidden = false; - system.defaults.dock.show-recents = false; - # don’t rearrange spaces based on the most recent use - system.defaults.dock.mru-spaces = false; - system.defaults.finder.AppleShowAllExtensions = true; - system.defaults.screencapture.location = "~/Documents/screenshots"; - - system.keyboard = { - enableKeyMapping = true; - remapCapsLockToControl = true; - }; - - system.defaults.CustomUserPreferences = { - "com.apple.desktopservices" = { - # Avoid creating .DS_Store files on network or USB volumes - DSDontWriteNetworkStores = true; - DSDontWriteUSBStores = true; - }; - }; -} diff --git a/hosts/common/nix.nix b/hosts/common/nix.nix deleted file mode 100644 index c828a16..0000000 --- a/hosts/common/nix.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: { - nix = { - package = pkgs.nixFlakes; - - gc = { - user = "root"; - automatic = true; - interval = { Weekday = 0; Hour = 2; Minute = 0; }; - options = "--delete-older-than 30d"; - }; - - settings = { - trusted-users = [ "@admin" "fcuny" ]; - experimental-features = [ "nix-command" "flakes" ]; - }; - }; - - nixpkgs.config = { - allowUnfree = true; - permittedInsecurePackages = [ - "nix-2.16.2" # FIXME https://github.com/nix-community/nixd/issues/357 - ]; - }; -} diff --git a/hosts/mba/default.nix b/hosts/mba/default.nix deleted file mode 100644 index 5908a53..0000000 --- a/hosts/mba/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - services.nix-daemon.enable = true; - - programs.zsh.enable = true; - - users.users.fcuny.home = "/Users/fcuny"; - - # Touch ID for sudo auth - security.pam.enableSudoTouchIdAuth = true; - - home-manager.users.fcuny = import ../../nix/profiles/home-manager/personal.nix; -} diff --git a/hosts/work/default.nix b/hosts/work/default.nix deleted file mode 100644 index 3db1e6f..0000000 --- a/hosts/work/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - services.nix-daemon.enable = true; - - programs.zsh.enable = true; - - users.users.fcuny.home = "/Users/fcuny"; - - # Touch ID for sudo auth - security.pam.enableSudoTouchIdAuth = true; - - home-manager.users.fcuny = import ../../nix/profiles/home-manager/work.nix; -} diff --git a/nix/flake/hosts.nix b/nix/flake/hosts.nix index a6390e5..36821b6 100644 --- a/nix/flake/hosts.nix +++ b/nix/flake/hosts.nix @@ -17,9 +17,9 @@ let }; }; } - ../../hosts/common/homebrew.nix - ../../hosts/common/macos.nix - ../../hosts/common/nix.nix + "${self}/nix/hosts/common/homebrew.nix" + "${self}/nix/hosts/common/macos.nix" + "${self}/nix/hosts/common/nix.nix" path { nixpkgs.overlays = [ @@ -35,8 +35,8 @@ in flake = mkMerge [ { darwinConfigurations = { - mba-fcuny = mkDarwinConfig "aarch64-darwin" ../../hosts/mba; - HQ-C02FK3Q7MD6T = mkDarwinConfig "x86_64-darwin" ../../hosts/work; + mba-fcuny = mkDarwinConfig "aarch64-darwin" "${self}/nix/hosts/mba"; + HQ-C02FK3Q7MD6T = mkDarwinConfig "x86_64-darwin" "${self}/nix/hosts/work"; }; } ]; diff --git a/nix/hosts/common/homebrew.nix b/nix/hosts/common/homebrew.nix new file mode 100644 index 0000000..b358695 --- /dev/null +++ b/nix/hosts/common/homebrew.nix @@ -0,0 +1,42 @@ +{ ... }: +{ + # Required for homebrew on aarch64 + environment.systemPath = [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; + + homebrew = { + enable = true; + onActivation.autoUpdate = true; + onActivation.upgrade = true; + + brews = [ + "aspell" # spelling + "envoy" # to do some testing with envoy + "go" # it's also installed by nix, but this is a fallback, just in case + "hashicorp/tap/boundary" # https://www.boundaryproject.io/ + "kind" # to run local k8s cluster + "kubebuilder" + "s3cmd" + ]; + + taps = [ + "homebrew/cask-fonts" + "hashicorp/tap" + ]; + + casks = [ + "1password-cli" + "docker" + "element" + "emacs" + "font-monaspace" # https://github.com/githubnext/monaspace + "font-source-code-pro" + "iterm2" + "netnewswire" + "transmission" + "vlc" + "wireshark" + "zed" + "zoom" + ]; + }; +} diff --git a/nix/hosts/common/macos.nix b/nix/hosts/common/macos.nix new file mode 100644 index 0000000..edc57a0 --- /dev/null +++ b/nix/hosts/common/macos.nix @@ -0,0 +1,23 @@ +{ ... }: { + system.defaults.dock.autohide = true; + system.defaults.dock.orientation = "left"; + system.defaults.dock.showhidden = false; + system.defaults.dock.show-recents = false; + # don’t rearrange spaces based on the most recent use + system.defaults.dock.mru-spaces = false; + system.defaults.finder.AppleShowAllExtensions = true; + system.defaults.screencapture.location = "~/Documents/screenshots"; + + system.keyboard = { + enableKeyMapping = true; + remapCapsLockToControl = true; + }; + + system.defaults.CustomUserPreferences = { + "com.apple.desktopservices" = { + # Avoid creating .DS_Store files on network or USB volumes + DSDontWriteNetworkStores = true; + DSDontWriteUSBStores = true; + }; + }; +} diff --git a/nix/hosts/common/nix.nix b/nix/hosts/common/nix.nix new file mode 100644 index 0000000..c828a16 --- /dev/null +++ b/nix/hosts/common/nix.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: { + nix = { + package = pkgs.nixFlakes; + + gc = { + user = "root"; + automatic = true; + interval = { Weekday = 0; Hour = 2; Minute = 0; }; + options = "--delete-older-than 30d"; + }; + + settings = { + trusted-users = [ "@admin" "fcuny" ]; + experimental-features = [ "nix-command" "flakes" ]; + }; + }; + + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "nix-2.16.2" # FIXME https://github.com/nix-community/nixd/issues/357 + ]; + }; +} diff --git a/nix/hosts/mba/default.nix b/nix/hosts/mba/default.nix new file mode 100644 index 0000000..d583df6 --- /dev/null +++ b/nix/hosts/mba/default.nix @@ -0,0 +1,13 @@ +{ self, ... }: +{ + services.nix-daemon.enable = true; + + programs.zsh.enable = true; + + users.users.fcuny.home = "/Users/fcuny"; + + # Touch ID for sudo auth + security.pam.enableSudoTouchIdAuth = true; + + home-manager.users.fcuny = import "${self}/nix/profiles/home-manager/personal.nix"; +} diff --git a/nix/hosts/work/default.nix b/nix/hosts/work/default.nix new file mode 100644 index 0000000..24cb95e --- /dev/null +++ b/nix/hosts/work/default.nix @@ -0,0 +1,13 @@ +{ self, ... }: +{ + services.nix-daemon.enable = true; + + programs.zsh.enable = true; + + users.users.fcuny.home = "/Users/fcuny"; + + # Touch ID for sudo auth + security.pam.enableSudoTouchIdAuth = true; + + home-manager.users.fcuny = import "${self}/nix/profiles/home-manager/work.nix"; +} -- cgit 1.4.1