From 87849b99cd8797ff36b198ed5f7d99e4017ba8f9 Mon Sep 17 00:00:00 2001 From: larstvei Date: Sun, 6 Oct 2024 01:03:31 +0200 Subject: [PATCH] Start cleaning up --- flake.nix | 4 +++- modules/core.nix | 26 ++++++++++++++++++++++++++ modules/home.nix | 24 ------------------------ modules/mac.nix | 13 +------------ nix/nix.conf | 3 --- 5 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 modules/core.nix delete mode 100644 nix/nix.conf diff --git a/flake.nix b/flake.nix index 6e6e773..263f83d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Lars' MacBook Pro"; + description = "My nix configuration."; inputs = { nixpkgs = { @@ -21,7 +21,9 @@ system = "aarch64-darwin"; modules = [ + ./modules/core.nix ./modules/mac.nix + home-manager.darwinModule { home-manager = { diff --git a/modules/core.nix b/modules/core.nix new file mode 100644 index 0000000..5fb1c87 --- /dev/null +++ b/modules/core.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +{ + nix = { + package = pkgs.nix; + + settings = { + system = "aarch64-darwin"; + extra-platforms = [ "aarch64-darwin" "x86_64-darwin" ]; + experimental-features = [ "nix-command" "flakes" ]; + build-users-group = "nixbld"; + trusted-users = [ "root" "larstvei" ]; + + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://larstvei.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "larstvei.cachix.org-1:mJq98qeTBnm2xNNibn2BEwN1ggi6uQg+5hWASdG1Vys=" + ]; + }; + }; +} diff --git a/modules/home.nix b/modules/home.nix index a3a0c4c..4ce96a0 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -65,30 +65,6 @@ home.file.".config/enchant/hunspell/".source = "${pkgs.hunspellDicts.nb_NO}/share/hunspell/"; - home.file.karabiner = { - target = ".config/karabiner/assets/complex_modifications/df_escape.json"; - text = builtins.toJSON { - title = "Simultaneously press f + d to escape"; - rules = [{ - description = "Simultaneously press f + d to escape"; - manipulators = [ - { - type = "basic"; - from = { - simultaneous = [ - { key_code = "f"; } - { key_code = "d"; } - ]; - }; - to = [ - { key_code = "escape"; } - ]; - } - ]; - }]; - }; - }; - programs = { fzf = { enable = true; diff --git a/modules/mac.nix b/modules/mac.nix index 86455a4..e95af7a 100644 --- a/modules/mac.nix +++ b/modules/mac.nix @@ -1,17 +1,5 @@ { pkgs, lib, ... }: { - nix = { - package = pkgs.nix; - - settings = { - system = "aarch64-darwin"; - extra-platforms = [ "aarch64-darwin" "x86_64-darwin" ]; - experimental-features = [ "nix-command" "flakes" ]; - build-users-group = "nixbld"; - trusted-users = [ "root" "larstvei" ]; - }; - }; - fonts.packages = with pkgs; [ fira fira-code @@ -26,6 +14,7 @@ users.users."larstvei".home = "/Users/larstvei"; programs.fish.enable = true; + system.activationScripts.postActivation.text = '' # Set the default shell as fish for the user. MacOS doesn't do this like nixOS does sudo chsh -s ${lib.getBin pkgs.fish}/bin/fish larstvei diff --git a/nix/nix.conf b/nix/nix.conf deleted file mode 100644 index d956ea0..0000000 --- a/nix/nix.conf +++ /dev/null @@ -1,3 +0,0 @@ -experimental-features = nix-command flakes -substituters = https://cache.nixos.org https://cache.nixos.org/ https://nix-community.cachix.org https://larstvei.cachix.org -trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= larstvei.cachix.org-1:mJq98qeTBnm2xNNibn2BEwN1ggi6uQg+5hWASdG1Vys=