From faae6721fbc8ff8bfd506197e85bb0d9e997349f Mon Sep 17 00:00:00 2001 From: winston Date: Thu, 9 Feb 2023 17:35:00 +0100 Subject: [PATCH] feat: switch from podman to docker, etc. --- configuration.nix | 6 ------ darwin.nix | 35 +++++++++++++++++++---------------- flake.lock | 15 +++++++++++++++ flake.nix | 33 +++++++++++++++++++++------------ home.nix | 9 ++++----- 5 files changed, 59 insertions(+), 39 deletions(-) diff --git a/configuration.nix b/configuration.nix index 8e1e0f5..4db301e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -125,12 +125,6 @@ in }; }; - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; - - users.users."${mainUser}" = { extraGroups = [ "wheel" ]; isNormalUser = true; diff --git a/darwin.nix b/darwin.nix index 1d33df2..8d098a4 100644 --- a/darwin.nix +++ b/darwin.nix @@ -1,20 +1,16 @@ { config, lib, pkgs, ... }: { - nix.settings.experimental-features = [ - "flakes" - "nix-command" - ]; - - environment.systemPackages = with pkgs; []; - - # Use a custom configuration.nix location. - # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin.nix - environment.darwinConfig = "$HOME/.config/nixpkgs/darwin.nix"; - # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; - nix.package = pkgs.nix; + nix = { + package = pkgs.nix; + gc.automatic = true; + settings = { + auto-optimise-store = true; + experimental-features = [ "flakes" "nix-command" ]; + }; + }; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog @@ -24,6 +20,7 @@ enable = true; caskArgs.no_quarantine = true; onActivation = { + autoUpdate = true; cleanup = "zap"; }; casks = [ @@ -34,9 +31,10 @@ "alfred" "bitwarden" "blender" - "eloston-chromium" "discord" + "docker" "easy-move-plus-resize" + "eloston-chromium" "firefox" "imageoptim" "insomnia" @@ -71,6 +69,11 @@ system.defaults.alf.stealthenabled = 1; services = { + dnsmasq = { + enable = true; + addresses."test" = "127.0.0.1"; + bind = "127.0.0.1"; + }; skhd = { enable = true; skhdConfig = builtins.readFile ./modules/skhd/skhdrc; @@ -80,15 +83,15 @@ package = pkgs.unstable.yabai; extraConfig = let rule = "yabai -m rule --add"; - ignored = app: builtins.concatStringsSep "\n" (map(e: "${rule} app=\"${e}\" manage=off sticky=off layer=above border=off") app); - unmanaged = app: builtins.concatStringsSep "\n" (map(e: "${rule} app=\"${e}\" manage=off") app); + ignored = app: builtins.concatStringsSep "\n" (map(e: ''${rule} app="${e}" manage=off sticky=off layer=above border=off'') app); + unmanaged = app: builtins.concatStringsSep "\n" (map(e: ''${rule} app="${e}" manage=off'') app); in '' # auto-inject scripting additions yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" sudo yabai --load-sa ${ignored ["JetBrains Toolbox" "Mullvad VPN" "Sip" "iStat Menus"]} - ${unmanaged ["GOG Galaxy" "Steam" "System Preferences"]} + ${unmanaged ["GOG Galaxy" "Steam" "System Settings"]} # etc. ${rule} manage=off border=off app="CleanShot" diff --git a/flake.lock b/flake.lock index 2dddf37..5e51f5e 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,20 @@ "type": "github" } }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -126,6 +140,7 @@ "root": { "inputs": { "darwin": "darwin", + "flake-utils": "flake-utils", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", diff --git a/flake.nix b/flake.nix index 5bad27b..a3952b3 100644 --- a/flake.nix +++ b/flake.nix @@ -15,13 +15,13 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/NUR/master"; - sops.url = "github:Mic92/sops-nix/feat/home-manager"; }; outputs = { self, darwin, + flake-utils, home-manager, nixpkgs, nixpkgs-unstable, @@ -30,16 +30,20 @@ ... }: let - system = "aarch64-darwin"; - overlay-unstable = final: prev: { + overlay-unstable-x86-64 = final: prev: { unstable = import nixpkgs-unstable { - inherit system; + system = "x86_64-linux"; + config.allowUnfree = true; + }; + }; + overlay-unstable-aarch64 = final: prev: { + unstable = import nixpkgs-unstable { + system = "aarch64-darwin"; config.allowUnfree = true; }; }; - pkgs = nixpkgs.legacyPackages.${system}; in - { + rec { # TODO: enable for NixOS # nixosConfigurations = { # "copium" = nixpkgs.lib.nixosSystem { @@ -53,22 +57,26 @@ # }; darwinConfigurations = { - "sashimi-slicer" = darwin.lib.darwinSystem { - inherit system; + "sashimi-slicer" = darwin.lib.darwinSystem rec { + system = "aarch64-darwin"; + # pkgs = import nixpkgs { + # inherit system; + # config.allowUnfree = true; + # }; modules = [ ./darwin.nix # make "pkgs.unstable" available ({ config, pkgs, ... }: { - nixpkgs.overlays = [ overlay-unstable ]; + nixpkgs.overlays = [ overlay-unstable-aarch64 ]; }) ]; }; }; - homeConfigurations.winston = home-manager.lib.homeManagerConfiguration { + homeConfigurations.winston = home-manager.lib.homeManagerConfiguration rec { pkgs = import nixpkgs { - inherit system; + system = "aarch64-darwin"; config.allowUnfree = true; }; @@ -77,7 +85,7 @@ sops.homeManagerModules.sops nur.nixosModules.nur ({ config, pkgs, ... }: { - nixpkgs.overlays = [ overlay-unstable ]; + nixpkgs.overlays = [ overlay-unstable-aarch64 ]; }) ]; extraSpecialArgs = { @@ -85,6 +93,7 @@ username = "winston"; homeDirectory = "/Users/winston"; personal = true; + flakePath = "/Users/winston/.config/nixpkgs"; }; }; }; diff --git a/home.nix b/home.nix index 196e166..6448bdd 100644 --- a/home.nix +++ b/home.nix @@ -29,7 +29,7 @@ in nixpkgs.config.allowUnfreePredicate = (pkg: true); catppuccin = { - defaultTheme = "mocha"; + defaultTheme = "frappe"; bat.enable = true; btop.enable = true; dircolors.enable = true; @@ -45,22 +45,21 @@ in packages = with pkgs; ([ zsh fd ffmpeg file imagemagick mdcat ranger ripgrep - - podman podman-compose qemu git-secret - - cargo deno rustc + cargo unstable.deno rustc (callPackage ./packages/org-stats {}) (callPackage ./packages/python3.catppuccin-catwalk {}) (nerdfonts.override { fonts = ["NerdFontsSymbolsOnly"]; }) + pkgs.unstable.jetbrains.idea-ultimate pkgs.unstable.jetbrains.clion pkgs.unstable.jetbrains.goland pkgs.unstable.jetbrains.phpstorm pkgs.unstable.jetbrains.pycharm-professional pkgs.unstable.jetbrains.webstorm pkgs.unstable.wezterm + (callPackage ./packages/helm-ls {}) ] ++ lib.optionals isDarwin [ iina ] ++ lib.optionals isLinux [