From 64a228fd4025e2c0c02f9fde76086b1a8ffd35f8 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Tue, 27 Aug 2024 19:42:07 -0500 Subject: [PATCH] mac-nix --- flake.lock | 126 ++++++++++-------------------- hosts/mac-nixos/configuration.nix | 66 ++++++++++++---- hosts/mac-nixos/gnome/default.nix | 5 +- hosts/mac-nixos/gnome/home.nix | 3 +- hosts/mac-nixos/home.nix | 60 ++++++++++++++ 5 files changed, 157 insertions(+), 103 deletions(-) diff --git a/flake.lock b/flake.lock index b2fe18a..8f61579 100644 --- a/flake.lock +++ b/flake.lock @@ -53,11 +53,11 @@ "yafas": "yafas" }, "locked": { - "lastModified": 1724696661, - "narHash": "sha256-tnT2qpwWAUEIdDZ8uhMP6zE+fFgjjWxCzvJ5u3WaASU=", + "lastModified": 1724760873, + "narHash": "sha256-pWFGeMQsnj3TpHG/BvOg5Qt5smgupDPeHmsd/ZH+DPg=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "e327b184c7b62b183fc9dd68c43b3e26a1469f35", + "rev": "f4510aa41ad74a3caa96365defbc356ab94e4521", "type": "github" }, "original": { @@ -92,11 +92,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1724636144, - "narHash": "sha256-yKpqZ6D8BP/D113KC1y5R/QAv9uy8SIRZToAZQDfhkI=", + "lastModified": 1724727194, + "narHash": "sha256-1qfV4NTz3SnuVAat9SfXzu2Jdu5156ZwODOeSZpF6xk=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "a6292140f1813e97d0cd0d2242685f9007b1b5d7", + "rev": "1b1bdf467e6f638889ea6a5f30e8d6182a7a16e3", "type": "github" }, "original": { @@ -135,11 +135,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1724394478, - "narHash": "sha256-JSiv2uwI4UJo/4pxt4255BfzWCiEberJmBC6pCxnzas=", + "lastModified": 1724740262, + "narHash": "sha256-cpFasbzOTlwLi4fNas6hDznVUdCJn/lMLxi7MAMG6hg=", "owner": "nix-community", "repo": "fenix", - "rev": "2e7bcdc4ef73aa56abd2f970e5a8b9c0cc87e614", + "rev": "703efdd9b5c6a7d5824afa348a24fbbf8ff226be", "type": "github" }, "original": { @@ -198,6 +198,21 @@ }, "flake-compat_4": { "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { "locked": { "lastModified": 1717312683, "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", @@ -331,11 +346,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1724440431, - "narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=", + "lastModified": 1724763886, + "narHash": "sha256-SzBtZs5z+YGM50oyt67R78qLhxG/wG5/SlVRsCF5kRc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "c8a54057aae480c56e28ef3e14e4960628ac495b", + "rev": "1cd12de659fab215624c630c37d1c62aa2b7824e", "type": "github" }, "original": { @@ -395,11 +410,11 @@ ] }, "locked": { - "lastModified": 1724412708, - "narHash": "sha256-tLr1k+UZLVumyqXRU8E5lBtLjsvHSy8e2NiamfkjpYg=", + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "owner": "nix-community", "repo": "home-manager", - "rev": "b18f3ebc4029c22d437e3424014c8597a8b459a0", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "type": "github" }, "original": { @@ -452,11 +467,11 @@ ] }, "locked": { - "lastModified": 1724304322, - "narHash": "sha256-/nrlMDubg9oG2VNANRBxsas5RbcJtB6IIDPZC3yHLW8=", + "lastModified": 1724753550, + "narHash": "sha256-idw4NE/j9j6LVD7nrw7lWq77z2J6S5oCHjJdIaPyGvw=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "924a18ea8df89a39166dd202f3e73cd022825768", + "rev": "1bda3a989a5785e09d710452c817ee2699c89a3a", "type": "github" }, "original": { @@ -610,10 +625,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "dirtyRev": "8a665fee82901878edaeb8ee120296a979db2dd2-dirty", - "dirtyShortRev": "8a665fe-dirty", - "lastModified": 1722469787, + "lastModified": 1724346840, "narHash": "sha256-nLaw2AFhDdBmbuWICe983Pbiq+GyNMPJMpSLWV6vVZA=", + "ref": "refs/heads/main", + "rev": "77b99b63b125d85693934c83b04e1797cbf7afe7", + "revCount": 483, "type": "git", "url": "file:///home/matt/nixos-apple-silicon" }, @@ -809,22 +825,6 @@ } }, "nixpkgs_6": { - "locked": { - "lastModified": 1724224976, - "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { "locked": { "lastModified": 1721466660, "narHash": "sha256-pFSxgSZqZ3h+5Du0KvEL1ccDZBwu4zvOil1zzrPNb3c=", @@ -914,11 +914,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1724345276, - "narHash": "sha256-MKvjkqVL/RJ3QXOA8tSUoK7HHXVGSB2AL+vKxU4Cf+c=", + "lastModified": 1724666781, + "narHash": "sha256-nOQDgjTDlWe0/+Ptf3o2p6UrznQFHnXBHRV1ZAsSpe8=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "9b724459b5900c2424f5069023d6596a8617284b", + "rev": "095926ea6f008477a15a2ec6b0b8797e2e5be0e5", "type": "github" }, "original": { @@ -936,11 +936,11 @@ ] }, "locked": { - "lastModified": 1724552650, - "narHash": "sha256-u1xzgrdRTL0DQhjXMgmEvl75IrL8zGf0RS34IQJXxeU=", + "lastModified": 1724638882, + "narHash": "sha256-ap2jIQi/FuUHR6HCht6ASWhoz8EiB99XmI8Esot38VE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "19fda552b69513df7b6aa5fcfd1412c0221467b1", + "rev": "19b70f147b9c67a759e35824b241f1ed92e46694", "type": "github" }, "original": { @@ -990,46 +990,6 @@ "type": "github" } }, - "rust-overlay_4": { - "flake": false, - "locked": { - "lastModified": 1724293269, - "narHash": "sha256-x/XhOAszT/ejditCHUtGOjQcVg2AQhrC/QVew3i7kTI=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "6dc6d34a3a217457d7044dcce32b6d537480a6a1", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "slimlock": { - "inputs": { - "nixpkgs": [ - "nix-inspect", - "nci", - "dream2nix", - "purescript-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688610262, - "narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=", - "owner": "thomashoneyman", - "repo": "slimlock", - "rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6", - "type": "github" - }, - "original": { - "owner": "thomashoneyman", - "repo": "slimlock", - "type": "github" - } - }, "sops-nix": { "inputs": { "nixpkgs": "nixpkgs_6", diff --git a/hosts/mac-nixos/configuration.nix b/hosts/mac-nixos/configuration.nix index 54c52b8..9eee765 100644 --- a/hosts/mac-nixos/configuration.nix +++ b/hosts/mac-nixos/configuration.nix @@ -2,39 +2,63 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ pkgs, ... }: +{ pkgs, lib, ... }: +let + plasma = false; +in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ../default.nix - ./gnome +# ./gnome # ./cosmic ]; - hardware.asahi.enable = true; - hardware.asahi.useExperimentalGPUDriver = true; - hardware.asahi.peripheralFirmwareDirectory = ./firmware; - hardware.asahi.setupAsahiSound = true; + hardware.asahi = { + enable = true; + useExperimentalGPUDriver = true; + peripheralFirmwareDirectory = ./firmware; + setupAsahiSound = true; + }; # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.configurationLimit = 3; - boot.loader.efi.canTouchEfiVariables = false; + boot.loader = { + systemd-boot = { + enable = true; + configurationLimit = 3; + }; + efi.canTouchEfiVariables = lib.mkForce false; + }; - apps.discover-wrapped.enable = lib.mkDefault true; + apps.discover-wrapped.enable = lib.mkDefault false; boot.extraModprobeConfig = '' options hid_apple iso_layout=0 ''; - networking.hostName = "mac-nixos"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # Networking configs + networking = { + hostName = "mac-nixos"; + + # Enable Network Manager + networkmanager = { + enable = lib.mkDefault true; + wifi.powersave = lib.mkDefault false; + settings.connectivity.uri = lib.mkDefault "http://nmcheck.gnome.org/check_network_status.txt"; + }; + }; services = { - displayManager.sddm.wayland.enable = lib.mkDefault true; - displayManager.sddm.enable = lib.mkDefault true; - desktopManager.plasma6.enable = lib.mkDefault true; + displayManager.sddm.wayland.enable = lib.mkDefault plasma; + displayManager.sddm.enable = lib.mkDefault plasma; + desktopManager.plasma6.enable = lib.mkDefault plasma; + + xserver = { + enable = true; + desktopManager.gnome.enable = lib.mkForce true; + displayManager.gdm.enable = lib.mkForce true; + }; # enable auto discovery of printers avahi = { @@ -44,7 +68,7 @@ }; # Enable Flatpak - flatpak.enable = lib.mkDefault true; + flatpak.enable = lib.mkDefault false; }; # Define a user account. Don't forget to set a password with ‘passwd’. @@ -56,11 +80,12 @@ firefox tree neofetch + gdm git box64 #minecraft prismlauncher - #vmware-horizon-client + vmware-horizon-client distrobox podman ]; @@ -73,6 +98,11 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ + apple-cursor + gnomeExtensions.dash-to-dock + gnomeExtensions.arcmenu + gnomeExtensions.appindicator + gnomeExtensions.tiling-assistant vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget ]; @@ -81,6 +111,8 @@ DBX_CONTAINER_MANAGER = "podman"; }; + nixpkgs.config.allowUnsupportedSystem = true; + # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you # accidentally delete configuration.nix. diff --git a/hosts/mac-nixos/gnome/default.nix b/hosts/mac-nixos/gnome/default.nix index 8049f9d..ef4e7cb 100644 --- a/hosts/mac-nixos/gnome/default.nix +++ b/hosts/mac-nixos/gnome/default.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { specialisation.gnome.configuration = { + home-manager.users.matt = import ./home.nix; apps.discover-wrapped.enable = false; @@ -19,7 +20,7 @@ displayManager.defaultSession = "gnome"; # Enable Flatpak - flatpak.enable = true; + flatpak.enable = false; # disable plasma displayManager.sddm.enable = false; @@ -29,4 +30,4 @@ # xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; -} \ No newline at end of file +} diff --git a/hosts/mac-nixos/gnome/home.nix b/hosts/mac-nixos/gnome/home.nix index 29d259f..eb50f1f 100644 --- a/hosts/mac-nixos/gnome/home.nix +++ b/hosts/mac-nixos/gnome/home.nix @@ -3,6 +3,7 @@ home.packages = with pkgs; [ nixfmt-rfc-style deadnix + gdm gnomeExtensions.dash-to-dock gnomeExtensions.arcmenu gnomeExtensions.appindicator @@ -38,4 +39,4 @@ "org/gtk/settings/file-chooser".clock-format = "12h"; }; }; -} \ No newline at end of file +} diff --git a/hosts/mac-nixos/home.nix b/hosts/mac-nixos/home.nix index 7800d32..6ac4375 100644 --- a/hosts/mac-nixos/home.nix +++ b/hosts/mac-nixos/home.nix @@ -1,4 +1,22 @@ { pkgs, ... }: +let + gtkThemeSize = "compact"; + gtkThemeAccent = "all"; + gtkThemeVariant = "nord"; + gtkThemeColor = "dark"; + gtkTheme = "Colloid-Dark-Compact-Nord"; + gtkThemePkg = pkgs.colloid-gtk-theme.override { + sizeVariants = [ gtkThemeSize ]; + colorVariants = [ gtkThemeColor ]; + themeVariants = [ gtkThemeAccent ]; + tweaks = [ gtkThemeVariant ]; + }; + iconThemeColor = "dark"; # "" "light" "dark" + # iconThemeVariant = "default"; # "" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" + iconThemeScheme = "nord"; # "" "nord" "dracula" "gruvbox" "everforest" "catppuccin" + iconTheme = "Colloid-${iconThemeScheme}-${iconThemeColor}"; + iconThemePkg = pkgs.colloid-icon-theme.override { schemeVariants = [ iconThemeScheme ]; }; +in { home.username = "matt"; @@ -50,9 +68,51 @@ programs.command-not-found.enable = true; home.packages = with pkgs; [ + apple-cursor nixfmt-rfc-style deadnix papirus-icon-theme + gnomeExtensions.dash-to-dock + gnomeExtensions.arcmenu + gnomeExtensions.appindicator + gnomeExtensions.tiling-assistant + gnome-tweaks + iconThemePkg + gtkThemePkg + orca-slicer + vesktop + vscodium ]; + + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface".clock-format = "12h"; + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + "org/gnome/desktop/interface".cursor-theme = "macOS-Monterey"; + "org/gnome/desktop/interface".enable-hot-corners = false; + "org/gnome/desktop/interface".font-antialiasing = "grayscale"; + "org/gnome/desktop/interface".font-hinting = "slight"; + "org/gnome/desktop/interface".icon-theme = iconTheme; + "org/gnome/desktop/interface".gtk-theme = gtkTheme; + "org/gnome/desktop/peripherals/mouse".accel-profile = "flat"; + "org/gnome/desktop/peripherals/touchpad".two-finger-scrolling-enabled = true; + "org/gnome/desktop/peripherals/touchpad".tap-to-click = true; + "org/gnome/mutter".experimental-features = [ + "scale-monitor-framebuffer" + "variable-refresh-rate" + ]; + "org/gnome/tweaks".show-extensions-notice = false; + "org/gnome/shell/extensions/user-theme".name = gtkTheme; + "org/gnome/shell".enabled-extensions = [ + "appindicatorsupport@rgcjonas.gmail.com" + "arcmenu@arcmenu.com" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "dash-to-dock@micxgx.gmail.com" + "tiling-assistant@leleat-on-github" + ]; + "org/gtk/settings/file-chooser".clock-format = "12h"; + }; + }; }