From 19db410ad58a30298b7318b9bec1434c9edcd714 Mon Sep 17 00:00:00 2001 From: Madeleine Date: Sun, 2 Apr 2023 18:01:14 +0100 Subject: [PATCH] fixes for NixOS --- flake.nix | 46 +++++++++++++------ maddie/common/browser.nix | 1 - maddie/{macos => common}/wezterm.nix | 0 maddie/macos/home.nix | 9 ---- maddie/macos/testing.nix | 5 -- maddie/{common => nixos}/calculator.nix | 2 +- maddie/nixos/drawterm.nix | 7 +++ maddie/nixos/librewolf.nix | 12 +++++ maddie/{common => nixos}/messaging.nix | 4 +- maddie/nixos/obs-studio.nix | 5 ++ maddie/nixos/tor.nix | 7 +++ systems/{desktop => mdesktop}/android.nix | 0 systems/{desktop => mdesktop}/audio.nix | 0 systems/{desktop => mdesktop}/bluetooth.nix | 0 systems/{desktop => mdesktop}/boot.nix | 0 systems/{desktop => mdesktop}/cpu.nix | 0 systems/{desktop => mdesktop}/disks.nix | 0 systems/{desktop => mdesktop}/doas.nix | 0 systems/{desktop => mdesktop}/firewall.nix | 0 systems/{desktop => mdesktop}/fonts.nix | 0 systems/{desktop => mdesktop}/gpg.nix | 0 systems/{desktop => mdesktop}/locale.nix | 0 systems/{desktop => mdesktop}/networking.nix | 0 systems/{desktop => mdesktop}/nix.nix | 0 systems/{desktop => mdesktop}/nixos.nix | 0 systems/{desktop => mdesktop}/nvidia.nix | 0 systems/{desktop => mdesktop}/packages.nix | 0 systems/{desktop => mdesktop}/security.nix | 0 systems/{desktop => mdesktop}/services.nix | 0 systems/{desktop => mdesktop}/ssh.nix | 2 +- systems/{desktop => mdesktop}/systemd.nix | 0 systems/{desktop => mdesktop}/users.nix | 0 .../{desktop => mdesktop}/virtualisation.nix | 0 systems/{desktop => mdesktop}/xorg.nix | 0 systems/{desktop => mdesktop}/yubikey.nix | 0 systems/{desktop => mdesktop}/zsh.nix | 0 .../{macbookpro => mmacbookpro}/finder.nix | 0 systems/{macbookpro => mmacbookpro}/fonts.nix | 0 systems/{macbookpro => mmacbookpro}/gpg.nix | 0 .../{macbookpro => mmacbookpro}/keyboard.nix | 0 systems/{macbookpro => mmacbookpro}/nix.nix | 0 .../{macbookpro => mmacbookpro}/packages.nix | 0 systems/{macbookpro => mmacbookpro}/ssh.nix | 0 systems/{macbookpro => mmacbookpro}/zsh.nix | 0 44 files changed, 66 insertions(+), 34 deletions(-) rename maddie/{macos => common}/wezterm.nix (100%) delete mode 100644 maddie/macos/testing.nix rename maddie/{common => nixos}/calculator.nix (71%) create mode 100644 maddie/nixos/drawterm.nix create mode 100644 maddie/nixos/librewolf.nix rename maddie/{common => nixos}/messaging.nix (64%) create mode 100644 maddie/nixos/obs-studio.nix create mode 100644 maddie/nixos/tor.nix rename systems/{desktop => mdesktop}/android.nix (100%) rename systems/{desktop => mdesktop}/audio.nix (100%) rename systems/{desktop => mdesktop}/bluetooth.nix (100%) rename systems/{desktop => mdesktop}/boot.nix (100%) rename systems/{desktop => mdesktop}/cpu.nix (100%) rename systems/{desktop => mdesktop}/disks.nix (100%) rename systems/{desktop => mdesktop}/doas.nix (100%) rename systems/{desktop => mdesktop}/firewall.nix (100%) rename systems/{desktop => mdesktop}/fonts.nix (100%) rename systems/{desktop => mdesktop}/gpg.nix (100%) rename systems/{desktop => mdesktop}/locale.nix (100%) rename systems/{desktop => mdesktop}/networking.nix (100%) rename systems/{desktop => mdesktop}/nix.nix (100%) rename systems/{desktop => mdesktop}/nixos.nix (100%) rename systems/{desktop => mdesktop}/nvidia.nix (100%) rename systems/{desktop => mdesktop}/packages.nix (100%) rename systems/{desktop => mdesktop}/security.nix (100%) rename systems/{desktop => mdesktop}/services.nix (100%) rename systems/{desktop => mdesktop}/ssh.nix (87%) rename systems/{desktop => mdesktop}/systemd.nix (100%) rename systems/{desktop => mdesktop}/users.nix (100%) rename systems/{desktop => mdesktop}/virtualisation.nix (100%) rename systems/{desktop => mdesktop}/xorg.nix (100%) rename systems/{desktop => mdesktop}/yubikey.nix (100%) rename systems/{desktop => mdesktop}/zsh.nix (100%) rename systems/{macbookpro => mmacbookpro}/finder.nix (100%) rename systems/{macbookpro => mmacbookpro}/fonts.nix (100%) rename systems/{macbookpro => mmacbookpro}/gpg.nix (100%) rename systems/{macbookpro => mmacbookpro}/keyboard.nix (100%) rename systems/{macbookpro => mmacbookpro}/nix.nix (100%) rename systems/{macbookpro => mmacbookpro}/packages.nix (100%) rename systems/{macbookpro => mmacbookpro}/ssh.nix (100%) rename systems/{macbookpro => mmacbookpro}/zsh.nix (100%) diff --git a/flake.nix b/flake.nix index 43ca0a7..e04aa42 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Maddie's NixOS configuration"; + description = "Maddie's Nix configurations"; inputs = { # Home manager @@ -13,39 +13,55 @@ outputs = { self, nixpkgs, home-manager, darwin }: let username = "maddie"; - pkgs = import nixpkgs { system = "aarch64-darwin"; config.allowUnfree = true; config.allowUnsupportedSystem = false; config.allowBroken = false; overlays = import ./overlays.nix; }; - utils = import ./utils pkgs; - specialArgs = { inherit username; inherit pkgs; }; + utils = import ./utils nixpkgs; + + nixpkgs_x86_64 = import nixpkgs { + config.allowUnfree = true; + config.allowUnsupportedSystem = false; + config.allowBroken = false; + overlays = import ./overlays.nix; + system = "x86_64-linux"; + }; + + nixpkgs_aarch64 = import nixpkgs { + config.allowUnfree = true; + config.allowUnsupportedSystem = false; + config.allowBroken = false; + overlays = import ./overlays.nix; + system = "aarch64-darwin"; + }; in { nixosConfigurations."luna" = nixpkgs.lib.nixosSystem { - inherit specialArgs; - inherit pkgs; + specialArgs = { inherit username; }; + pkgs = nixpkgs_x86_64; system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager { home-manager.users.${username}.imports = utils.nixFilesIn ./maddie/common ++ utils.nixFilesIn ./maddie/nixos; - home-manager.extraSpecialArgs = specialArgs; + home-manager.extraSpecialArgs = { inherit username; pkgs = nixpkgs_x86_64; }; } - ] ++ utils.nixFilesIn ./systems/desktop; + ] ++ utils.nixFilesIn ./systems/mdesktop; }; - darwinConfigurations."MMacBookPro" = darwin.lib.darwinSystem { - inherit specialArgs; - inherit pkgs; + darwinConfigurations."MMacBookPro" = darwin.lib.darwinSystem + { + pkgs = nixpkgs_aarch64; + specialArgs = { inherit username; }; system = "aarch64-darwin"; modules = [ home-manager.darwinModules.home-manager { home-manager.useUserPackages = true; home-manager.users.${username}.imports = utils.nixFilesIn ./maddie/common ++ utils.nixFilesIn ./maddie/macos; - home-manager.extraSpecialArgs = specialArgs; + home-manager.extraSpecialArgs = { inherit username; pkgs = nixpkgs_aarch64; }; } - ] ++ utils.nixFilesIn ./systems/macbookpro; + ] ++ utils.nixFilesIn ./systems/mmacbookpro; }; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; - formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixpkgs-fmt; + formatter.x86_64-linux = nixpkgs_x86_64.legacyPackages.x86_64-linux.nixpkgs-fmt; + formatter.aarch64-darwin = nixpkgs_aarch64.legacyPackages.aarch64-darwin.nixpkgs-fmt; }; } + diff --git a/maddie/common/browser.nix b/maddie/common/browser.nix index d0db707..21fd758 100644 --- a/maddie/common/browser.nix +++ b/maddie/common/browser.nix @@ -2,7 +2,6 @@ { home.packages = with pkgs; [ - # librewolf amfora lynx ]; diff --git a/maddie/macos/wezterm.nix b/maddie/common/wezterm.nix similarity index 100% rename from maddie/macos/wezterm.nix rename to maddie/common/wezterm.nix diff --git a/maddie/macos/home.nix b/maddie/macos/home.nix index 1b361b4..ea16015 100644 --- a/maddie/macos/home.nix +++ b/maddie/macos/home.nix @@ -7,13 +7,4 @@ homeDirectory = lib.mkForce "/Users/${username}"; stateVersion = "23.05"; }; - - # Install MacOS applications to the user environment if the targetPlatform is Darwin - home.file."Applications/home-manager-linked".source = let - apps = pkgs.buildEnv { - name = "home-manager-applications"; - paths = config.home.packages; - pathsToLink = "/Applications"; - }; - in lib.mkIf pkgs.stdenv.targetPlatform.isDarwin "${apps}/Applications"; } diff --git a/maddie/macos/testing.nix b/maddie/macos/testing.nix deleted file mode 100644 index cf79e90..0000000 --- a/maddie/macos/testing.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, ... }: - -{ - programs.kitty.enable = true; -} diff --git a/maddie/common/calculator.nix b/maddie/nixos/calculator.nix similarity index 71% rename from maddie/common/calculator.nix rename to maddie/nixos/calculator.nix index d371b89..fb1cf64 100644 --- a/maddie/common/calculator.nix +++ b/maddie/nixos/calculator.nix @@ -2,6 +2,6 @@ { home.packages = with pkgs; [ - # nodePackages.insect + nodePackages.insect ]; } diff --git a/maddie/nixos/drawterm.nix b/maddie/nixos/drawterm.nix new file mode 100644 index 0000000..16ca2db --- /dev/null +++ b/maddie/nixos/drawterm.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + drawterm + ]; +} diff --git a/maddie/nixos/librewolf.nix b/maddie/nixos/librewolf.nix new file mode 100644 index 0000000..b0d8d2b --- /dev/null +++ b/maddie/nixos/librewolf.nix @@ -0,0 +1,12 @@ +{ config, ... }: + +{ + programs.librewolf = { + enable = true; + settings = { + "browser.uidensity" = 1; + "webgl.disabled" = false; + "privacy.resistFingerprinting" = false; + }; + }; +} diff --git a/maddie/common/messaging.nix b/maddie/nixos/messaging.nix similarity index 64% rename from maddie/common/messaging.nix rename to maddie/nixos/messaging.nix index 832d5f6..1f8bd2a 100644 --- a/maddie/common/messaging.nix +++ b/maddie/nixos/messaging.nix @@ -3,8 +3,8 @@ { home.packages = with pkgs; [ element-desktop # Matrix client - # signal-desktop # Signal client + signal-desktop # Signal client discord-canary # Discord client - #ripcord # Better discord client + ripcord # Better discord client ]; } diff --git a/maddie/nixos/obs-studio.nix b/maddie/nixos/obs-studio.nix new file mode 100644 index 0000000..07f8a87 --- /dev/null +++ b/maddie/nixos/obs-studio.nix @@ -0,0 +1,5 @@ +{ config, ... }: + +{ + programs.obs-studio.enable = true; +} diff --git a/maddie/nixos/tor.nix b/maddie/nixos/tor.nix new file mode 100644 index 0000000..e2a7d4c --- /dev/null +++ b/maddie/nixos/tor.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + tor-browser-bundle-bin + ]; +} diff --git a/systems/desktop/android.nix b/systems/mdesktop/android.nix similarity index 100% rename from systems/desktop/android.nix rename to systems/mdesktop/android.nix diff --git a/systems/desktop/audio.nix b/systems/mdesktop/audio.nix similarity index 100% rename from systems/desktop/audio.nix rename to systems/mdesktop/audio.nix diff --git a/systems/desktop/bluetooth.nix b/systems/mdesktop/bluetooth.nix similarity index 100% rename from systems/desktop/bluetooth.nix rename to systems/mdesktop/bluetooth.nix diff --git a/systems/desktop/boot.nix b/systems/mdesktop/boot.nix similarity index 100% rename from systems/desktop/boot.nix rename to systems/mdesktop/boot.nix diff --git a/systems/desktop/cpu.nix b/systems/mdesktop/cpu.nix similarity index 100% rename from systems/desktop/cpu.nix rename to systems/mdesktop/cpu.nix diff --git a/systems/desktop/disks.nix b/systems/mdesktop/disks.nix similarity index 100% rename from systems/desktop/disks.nix rename to systems/mdesktop/disks.nix diff --git a/systems/desktop/doas.nix b/systems/mdesktop/doas.nix similarity index 100% rename from systems/desktop/doas.nix rename to systems/mdesktop/doas.nix diff --git a/systems/desktop/firewall.nix b/systems/mdesktop/firewall.nix similarity index 100% rename from systems/desktop/firewall.nix rename to systems/mdesktop/firewall.nix diff --git a/systems/desktop/fonts.nix b/systems/mdesktop/fonts.nix similarity index 100% rename from systems/desktop/fonts.nix rename to systems/mdesktop/fonts.nix diff --git a/systems/desktop/gpg.nix b/systems/mdesktop/gpg.nix similarity index 100% rename from systems/desktop/gpg.nix rename to systems/mdesktop/gpg.nix diff --git a/systems/desktop/locale.nix b/systems/mdesktop/locale.nix similarity index 100% rename from systems/desktop/locale.nix rename to systems/mdesktop/locale.nix diff --git a/systems/desktop/networking.nix b/systems/mdesktop/networking.nix similarity index 100% rename from systems/desktop/networking.nix rename to systems/mdesktop/networking.nix diff --git a/systems/desktop/nix.nix b/systems/mdesktop/nix.nix similarity index 100% rename from systems/desktop/nix.nix rename to systems/mdesktop/nix.nix diff --git a/systems/desktop/nixos.nix b/systems/mdesktop/nixos.nix similarity index 100% rename from systems/desktop/nixos.nix rename to systems/mdesktop/nixos.nix diff --git a/systems/desktop/nvidia.nix b/systems/mdesktop/nvidia.nix similarity index 100% rename from systems/desktop/nvidia.nix rename to systems/mdesktop/nvidia.nix diff --git a/systems/desktop/packages.nix b/systems/mdesktop/packages.nix similarity index 100% rename from systems/desktop/packages.nix rename to systems/mdesktop/packages.nix diff --git a/systems/desktop/security.nix b/systems/mdesktop/security.nix similarity index 100% rename from systems/desktop/security.nix rename to systems/mdesktop/security.nix diff --git a/systems/desktop/services.nix b/systems/mdesktop/services.nix similarity index 100% rename from systems/desktop/services.nix rename to systems/mdesktop/services.nix diff --git a/systems/desktop/ssh.nix b/systems/mdesktop/ssh.nix similarity index 87% rename from systems/desktop/ssh.nix rename to systems/mdesktop/ssh.nix index d87450f..c3c1479 100644 --- a/systems/desktop/ssh.nix +++ b/systems/mdesktop/ssh.nix @@ -7,5 +7,5 @@ settings.passwordAuthentication = false; }; programs.ssh.hostKeyAlgorithms = [ "sk-ssh-ed25519@openssh.com" "ssh-ed25519" ]; - users.users.${username}.openssh.authorizedKeys.keyFiles = [ ../maddie/ssh/id_ed25519_sk.pub ]; + users.users.${username}.openssh.authorizedKeys.keyFiles = [ ../../maddie/common/ssh/id_ed25519_sk.pub ]; } diff --git a/systems/desktop/systemd.nix b/systems/mdesktop/systemd.nix similarity index 100% rename from systems/desktop/systemd.nix rename to systems/mdesktop/systemd.nix diff --git a/systems/desktop/users.nix b/systems/mdesktop/users.nix similarity index 100% rename from systems/desktop/users.nix rename to systems/mdesktop/users.nix diff --git a/systems/desktop/virtualisation.nix b/systems/mdesktop/virtualisation.nix similarity index 100% rename from systems/desktop/virtualisation.nix rename to systems/mdesktop/virtualisation.nix diff --git a/systems/desktop/xorg.nix b/systems/mdesktop/xorg.nix similarity index 100% rename from systems/desktop/xorg.nix rename to systems/mdesktop/xorg.nix diff --git a/systems/desktop/yubikey.nix b/systems/mdesktop/yubikey.nix similarity index 100% rename from systems/desktop/yubikey.nix rename to systems/mdesktop/yubikey.nix diff --git a/systems/desktop/zsh.nix b/systems/mdesktop/zsh.nix similarity index 100% rename from systems/desktop/zsh.nix rename to systems/mdesktop/zsh.nix diff --git a/systems/macbookpro/finder.nix b/systems/mmacbookpro/finder.nix similarity index 100% rename from systems/macbookpro/finder.nix rename to systems/mmacbookpro/finder.nix diff --git a/systems/macbookpro/fonts.nix b/systems/mmacbookpro/fonts.nix similarity index 100% rename from systems/macbookpro/fonts.nix rename to systems/mmacbookpro/fonts.nix diff --git a/systems/macbookpro/gpg.nix b/systems/mmacbookpro/gpg.nix similarity index 100% rename from systems/macbookpro/gpg.nix rename to systems/mmacbookpro/gpg.nix diff --git a/systems/macbookpro/keyboard.nix b/systems/mmacbookpro/keyboard.nix similarity index 100% rename from systems/macbookpro/keyboard.nix rename to systems/mmacbookpro/keyboard.nix diff --git a/systems/macbookpro/nix.nix b/systems/mmacbookpro/nix.nix similarity index 100% rename from systems/macbookpro/nix.nix rename to systems/mmacbookpro/nix.nix diff --git a/systems/macbookpro/packages.nix b/systems/mmacbookpro/packages.nix similarity index 100% rename from systems/macbookpro/packages.nix rename to systems/mmacbookpro/packages.nix diff --git a/systems/macbookpro/ssh.nix b/systems/mmacbookpro/ssh.nix similarity index 100% rename from systems/macbookpro/ssh.nix rename to systems/mmacbookpro/ssh.nix diff --git a/systems/macbookpro/zsh.nix b/systems/mmacbookpro/zsh.nix similarity index 100% rename from systems/macbookpro/zsh.nix rename to systems/mmacbookpro/zsh.nix