about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-09-16 19:01:53 +0900
committersefidel <contact@sefidel.net>2023-09-16 19:01:53 +0900
commit4188df087c133fe1899641d43b20b326253cab98 (patch)
treec24338f47c2578ef7d6b6c9f94727d0956e79776
parent203deb6b381aa98af908a50d7081d4a24aeaae7a (diff)
downloadnixrc-4188df087c133fe1899641d43b20b326253cab98.tar.gz
nixrc-4188df087c133fe1899641d43b20b326253cab98.zip
feat(darwin)!: remove darwin
-rw-r--r--darwin/default.nix12
-rw-r--r--darwin/kompakt-darwin/configuration.nix59
-rw-r--r--flake.lock94
-rw-r--r--flake.nix11
-rw-r--r--home/default.nix40
-rw-r--r--lib/mk_darwin.nix23
-rw-r--r--nixos/default.nix10
-rw-r--r--nixos/kompakt/configuration.nix189
-rw-r--r--nixos/kompakt/hardware-configuration.nix58
-rw-r--r--nixos/kompakt/secrets/secrets.yaml31
10 files changed, 1 insertions, 526 deletions
diff --git a/darwin/default.nix b/darwin/default.nix
deleted file mode 100644
index acc1fcb..0000000
--- a/darwin/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ self, darwin, unstable, ... } @ inputs:
-
-{
-  kompakt-darwin = self.lib.mkDarwin {
-    name = "kompakt-darwin";
-    system = "aarch64-darwin";
-    nixpkgs = unstable;
-    extraModules = [
-      ../modules/cachix
-    ];
-  };
-}
diff --git a/darwin/kompakt-darwin/configuration.nix b/darwin/kompakt-darwin/configuration.nix
deleted file mode 100644
index 514cef2..0000000
--- a/darwin/kompakt-darwin/configuration.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ config, pkgs, lib, ... }:
-
-{
-  nix = {
-    settings.trusted-users = [
-      "@admin"
-    ];
-
-    settings.auto-optimise-store = lib.mkDefault true;
-    configureBuildUsers = true;
-    gc.automatic = lib.mkDefault true;
-    gc.options = lib.mkDefault "--delete-older-than 10d";
-    extraOptions = ''
-      experimental-features = nix-command flakes
-      extra-platforms = x86_64-darwin aarch64-darwin
-    '';
-  };
-
-  # List packages installed in system profile. To search by name, run:
-  # $ nix-env -qaP | grep wget
-  environment.systemPackages =
-    [
-      pkgs.vim
-    ];
-
-  # Use a custom configuration.nix location.
-  # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
-  # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
-
-  # Auto upgrade nix package and the daemon service.
-  services.nix-daemon.enable = true;
-  # nix.package = pkgs.nix;
-
-  users.users.sefidel = {
-    name = "sefidel";
-    home = "/Users/sefidel";
-  };
-
-  # Create /etc/zshrc that loads the nix-darwin environment.
-  programs.zsh.enable = true; # default shell on catalina
-  # programs.fish.enable = true;
-
-  # Make applications pop up in finder/spotlight
-  system.activationScripts.applications.text = pkgs.lib.mkForce (
-    ''
-      echo "setting up ~/Applications..." >&2
-      rm -rf ~/Applications/Nix\ Apps
-      mkdir -p ~/Applications/Nix\ Apps
-      for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do
-        src="$(/usr/bin/stat -f%Y "$app")"
-        cp -r "$src" ~/Applications/Nix\ Apps
-      done
-    ''
-  );
-
-  # Used for backwards compatibility, please read the changelog before changing.
-  # $ darwin-rebuild changelog
-  system.stateVersion = 4;
-}
diff --git a/flake.lock b/flake.lock
index 4325261..b0f2a82 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,46 +1,8 @@
 {
   "nodes": {
-    "apple-silicon": {
-      "inputs": {
-        "flake-compat": "flake-compat",
-        "nixpkgs": [
-          "unstable"
-        ],
-        "rust-overlay": "rust-overlay"
-      },
-      "locked": {
-        "lastModified": 1694226967,
-        "narHash": "sha256-AY0ytoBBVYHKzY8p/8MQQW3hgMAqHBinQxbYPjIKawI=",
-        "owner": "tpwrules",
-        "repo": "nixos-apple-silicon",
-        "rev": "d63ab027a49c249f5c0ba85ea988d7bb6db83cd9",
-        "type": "github"
-      },
-      "original": {
-        "owner": "tpwrules",
-        "repo": "nixos-apple-silicon",
-        "type": "github"
-      }
-    },
-    "asahi-firmware": {
-      "flake": false,
-      "locked": {
-        "lastModified": 1676438596,
-        "narHash": "sha256-VPaipnOsayWTBzT3/VOt+ycAXVOgy/+2hjFZaFcyNHg=",
-        "ref": "refs/heads/main",
-        "rev": "5053e89a1c00426bafa133630aab2c765bd64e8d",
-        "revCount": 1,
-        "type": "git",
-        "url": "https://git.exotic.sh/pub/sefidel/asahi-firmware"
-      },
-      "original": {
-        "type": "git",
-        "url": "https://git.exotic.sh/pub/sefidel/asahi-firmware"
-      }
-    },
     "crane": {
       "inputs": {
-        "flake-compat": "flake-compat_2",
+        "flake-compat": "flake-compat",
         "flake-utils": [
           "helix",
           "flake-utils"
@@ -68,42 +30,7 @@
         "type": "github"
       }
     },
-    "darwin": {
-      "inputs": {
-        "nixpkgs": [
-          "unstable"
-        ]
-      },
-      "locked": {
-        "lastModified": 1694497842,
-        "narHash": "sha256-z03v/m0OwcLBok97KcUgMl8ZFw5Xwsi2z+n6nL7JdXY=",
-        "owner": "LnL7",
-        "repo": "nix-darwin",
-        "rev": "4496ab26628c5f43d2a5c577a06683c753e32fe2",
-        "type": "github"
-      },
-      "original": {
-        "owner": "LnL7",
-        "repo": "nix-darwin",
-        "type": "github"
-      }
-    },
     "flake-compat": {
-      "locked": {
-        "lastModified": 1688025799,
-        "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
-        "owner": "nix-community",
-        "repo": "flake-compat",
-        "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nix-community",
-        "repo": "flake-compat",
-        "type": "github"
-      }
-    },
-    "flake-compat_2": {
       "flake": false,
       "locked": {
         "lastModified": 1673956053,
@@ -290,9 +217,6 @@
     },
     "root": {
       "inputs": {
-        "apple-silicon": "apple-silicon",
-        "asahi-firmware": "asahi-firmware",
-        "darwin": "darwin",
         "helix": "helix",
         "home-manager": "home-manager",
         "impermanence": "impermanence",
@@ -325,22 +249,6 @@
         "type": "github"
       }
     },
-    "rust-overlay": {
-      "flake": false,
-      "locked": {
-        "lastModified": 1686795910,
-        "narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
-        "owner": "oxalica",
-        "repo": "rust-overlay",
-        "rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
-        "type": "github"
-      },
-      "original": {
-        "owner": "oxalica",
-        "repo": "rust-overlay",
-        "type": "github"
-      }
-    },
     "sops-nix": {
       "inputs": {
         "nixpkgs": [
diff --git a/flake.nix b/flake.nix
index 3aa5157..0dcca80 100644
--- a/flake.nix
+++ b/flake.nix
@@ -6,15 +6,6 @@
     unstable-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
     nixpkgs-2211.url = "github:nixos/nixpkgs/nixos-22.11";
 
-    darwin.url = "github:LnL7/nix-darwin";
-    darwin.inputs.nixpkgs.follows = "unstable";
-
-    apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
-    apple-silicon.inputs.nixpkgs.follows = "unstable";
-
-    asahi-firmware.url = "git+https://git.exotic.sh/pub/sefidel/asahi-firmware";
-    asahi-firmware.flake = false;
-
     home-manager.url = "github:nix-community/home-manager";
     home-manager.inputs.nixpkgs.follows = "unstable";
 
@@ -38,8 +29,6 @@
     {
       nixosConfigurations = import ./nixos inputs;
 
-      darwinConfigurations = import ./darwin inputs;
-
       homeConfigurations = import ./home inputs;
 
       packages.x86_64-linux = self.lib.nixosConfigurationsAsPackages.x86_64-linux
diff --git a/home/default.nix b/home/default.nix
index bbba0e7..0232476 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -46,46 +46,6 @@
     version = "23.11";
   };
 
-  "sefidel@kompakt" = self.lib.mkHome {
-    username = "sefidel";
-    hostname = "kompakt";
-    pkgs = import unstable { system = "aarch64-linux"; overlays = with inputs; [ rust.overlays.default neovim.overlay ]; };
-
-    extraModules = [
-      ./profiles/populate.nix
-      ./profiles/base
-      ./profiles/gui
-      ./profiles/browsing
-      ./profiles/development
-      ./profiles/communication
-      ./profiles/multimedia
-      ./profiles/research
-    ];
-
-    version = "23.05";
-  };
-
-  "sefidel@kompakt-darwin" = self.lib.mkHome {
-    username = "sefidel";
-    hostname = "kompakt-darwin";
-    pkgs = import unstable { system = "aarch64-darwin"; overlays = with inputs; [ rust.overlays.default /* neovim.overlay  // TODO: https://github.com/neovim/neovim/issues/24124 */ helix.overlays.default ]; };
-
-    extraModules = [
-      ./profiles/populate.nix
-      ./profiles/base
-      ./profiles/browsing
-      ./profiles/development
-      ./profiles/communication
-      ./profiles/multimedia
-      ./profiles/research
-      ./profiles/fonts
-
-      inputs.sops-nix.homeManagerModules.sops
-    ];
-
-    version = "23.05";
-  };
-
   "sefidel@cobalt" = self.lib.mkHome {
     username = "sefidel";
     hostname = "cobalt";
diff --git a/lib/mk_darwin.nix b/lib/mk_darwin.nix
deleted file mode 100644
index de4fc4e..0000000
--- a/lib/mk_darwin.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ self, darwin, ... } @ args:
-
-{ name, nixpkgs, system ? "aarch64-darwin", overlays ? null, extraModules ? null }:
-darwin.lib.darwinSystem (
-  let
-    configFolder = "${self}/darwin";
-    entryPoint = "${configFolder}/${name}/configuration.nix";
-  in
-  {
-    system = system;
-    inputs = { inherit darwin nixpkgs; };
-
-    modules = [
-      {
-        _module.args = args;
-        networking.hostName = name;
-      }
-      entryPoint
-      ../modules/nix.nix
-    ] ++ nixpkgs.lib.optional (overlays != null) { nixpkgs.overlays = overlays; }
-    ++ nixpkgs.lib.optionals (extraModules != null) extraModules;
-  }
-)
diff --git a/nixos/default.nix b/nixos/default.nix
index bc14379..ecf182c 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -34,14 +34,4 @@
       inputs.impermanence.nixosModules.impermanence
     ];
   };
-
-  kompakt = self.lib.mkSystem {
-    name = "kompakt";
-    system = "aarch64-linux";
-    nixpkgs = unstable-small;
-    extraModules = [
-      inputs.sops-nix.nixosModules.sops
-      inputs.impermanence.nixosModules.impermanence
-    ];
-  };
 }
diff --git a/nixos/kompakt/configuration.nix b/nixos/kompakt/configuration.nix
deleted file mode 100644
index 31a0a5c..0000000
--- a/nixos/kompakt/configuration.nix
+++ /dev/null
@@ -1,189 +0,0 @@
-{ config, lib, pkgs, apple-silicon, asahi-firmware, ... }:
-
-{
-  imports =
-    [
-      ./hardware-configuration.nix
-      apple-silicon.nixosModules.apple-silicon-support
-    ];
-
-  nixpkgs.overlays = [ apple-silicon.overlays.apple-silicon-overlay ];
-
-  boot.loader.systemd-boot.enable = true;
-  boot.loader.efi.canTouchEfiVariables = false;
-
-  # Specify path to peripheral firmware files.
-  # This lets the flake stay pure.
-  hardware.asahi.peripheralFirmwareDirectory = asahi-firmware;
-  # Or completely disable extraction and managemement of them completely:
-  # hardware.asahi.extractPeripheralFirmware = false;
-
-  # Enable GPU acceleration
-  # TODO: Fix scaling issue
-  # hardware.asahi.useExperimentalGPUDriver = true;
-  # hardware.asahi.experimentalGPUInstallMode = "overlay";
-  hardware.opengl.enable = true;
-
-  boot.kernelParams = [
-    "console=tty1"
-  ];
-
-  boot.supportedFilesystems = [ "zfs" ];
-
-  networking.hostName = "kompakt";
-  networking.hostId = "9c8c0140";
-
-  boot.initrd.postDeviceCommands = lib.mkAfter ''
-    zfs rollback -r rpool/local/root@blank
-  '';
-
-  networking.wireless.iwd.enable = true;
-  hardware.bluetooth.enable = true;
-
-  time.timeZone = "Asia/Seoul";
-
-  i18n.defaultLocale = "en_US.UTF-8";
-  console = {
-    font = "ter-v32n";
-    packages = with pkgs; [ terminus_font ];
-  };
-
-  services.printing.enable = true;
-
-  sound.enable = false;
-
-  services.pipewire = {
-    enable = true;
-
-    alsa.enable = true;
-    alsa.support32Bit = true;
-    pulse.enable = true;
-  };
-
-  # Backlight control
-  programs.light.enable = true;
-  services.actkbd = {
-    enable = true;
-    bindings = [
-      { keys = [ 224 ]; events = [ "key" ]; command = "/run/current-system/sw/bin/light -U 10"; }
-      { keys = [ 225 ]; events = [ "key" ]; command = "/run/current-system/sw/bin/light -A 10"; }
-    ];
-  };
-
-  fonts = {
-    fontDir.enable = true;
-
-    packages = with pkgs; [
-      dina-font
-      jetbrains-mono
-      sarasa-gothic
-      siji
-      emacs-all-the-icons-fonts
-      twemoji-color-font
-      (nerdfonts.override { fonts = [ "Iosevka" "JetBrainsMono" ]; })
-    ];
-
-    fontconfig = {
-      enable = true;
-
-      defaultFonts = {
-        serif = [
-          "Sarasa Gothic C"
-          "Sarasa Gothic J"
-          "Sarasa Gothic K"
-        ];
-
-        sansSerif = [
-          "Sarasa Gothic C"
-          "Sarasa Gothic J"
-          "Sarasa Gothic K"
-        ];
-
-        monospace = [
-          "Dina"
-          "Iosevka Nerd Font"
-          "JetBrainsMono Nerd Font"
-        ];
-
-        emoji = [
-          "Siji"
-          "Twitter Color Emoji"
-        ];
-      };
-    };
-  };
-
-  services.greetd = {
-    enable = true;
-    vt = 2;
-
-    settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet -t -c sway";
-  };
-
-  programs = {
-    sway.enable = true;
-    sway.extraPackages = lib.mkForce [ ];
-
-    zsh.enable = true;
-    zsh.enableCompletion = false;
-  };
-
-  xdg.portal = {
-    enable = true;
-    extraPortals = with pkgs; [
-      xdg-desktop-portal-gtk
-      xdg-desktop-portal-wlr
-    ];
-  };
-
-  sops.defaultSopsFile = ./secrets/secrets.yaml;
-  sops.secrets.root-password.neededForUsers = true;
-  sops.secrets.sefidel-password.neededForUsers = true;
-
-  users.mutableUsers = false;
-
-  users.users = {
-    root.hashedPasswordFile = config.sops.secrets.root-password.path;
-    sefidel = {
-      isNormalUser = true;
-      shell = pkgs.zsh;
-      hashedPasswordFile = config.sops.secrets.sefidel-password.path;
-
-      extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
-    };
-  };
-
-  services.openssh.enable = true;
-  services.openssh.hostKeys = [
-    {
-      path = "/persist/ssh/ssh_host_ed25519_key";
-      type = "ed25519";
-    }
-    {
-      path = "/persist/ssh/ssh_host_rsa_key";
-      type = "rsa";
-      bits = 4096;
-    }
-  ];
-
-  environment.systemPackages = with pkgs; [
-    git
-  ];
-
-  environment.persistence."/persist".directories = [
-    "/var/lib/iwd"
-    "/etc/nixos"
-  ];
-
-  fileSystems."/persist".neededForBoot = true;
-
-  # This value determines the NixOS release from which the default
-  # settings for stateful data, like file locations and database versions
-  # on your system were taken. It‘s perfectly fine and recommended to leave
-  # this value at the release version of the first install of this system.
-  # Before changing this value read the documentation for this option
-  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
-  system.stateVersion = "23.05"; # Did you read the comment?
-
-}
-
diff --git a/nixos/kompakt/hardware-configuration.nix b/nixos/kompakt/hardware-configuration.nix
deleted file mode 100644
index ab2c6ed..0000000
--- a/nixos/kompakt/hardware-configuration.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-# Do not modify this file!  It was generated by ‘nixos-generate-config’
-# and may be overwritten by future invocations.  Please make changes
-# to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
-
-{
-  imports =
-    [
-      (modulesPath + "/installer/scan/not-detected.nix")
-    ];
-
-  boot.initrd.availableKernelModules = [ "usb_storage" ];
-  boot.initrd.kernelModules = [ ];
-  boot.kernelModules = [ ];
-  boot.extraModulePackages = [ ];
-
-  fileSystems."/" =
-    {
-      device = "rpool/local/root";
-      fsType = "zfs";
-    };
-
-  fileSystems."/boot" =
-    {
-      device = "/dev/disk/by-uuid/01AC-1BF6";
-      fsType = "vfat";
-    };
-
-  fileSystems."/nix" =
-    {
-      device = "rpool/local/nix";
-      fsType = "zfs";
-    };
-
-  fileSystems."/persist" =
-    {
-      device = "rpool/safe/persist";
-      fsType = "zfs";
-    };
-
-  fileSystems."/home" =
-    {
-      device = "rpool/safe/home";
-      fsType = "zfs";
-    };
-
-  swapDevices = [ ];
-
-  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
-  # (the default) this is the recommended approach. When using systemd-networkd it's
-  # still possible to use this option, but it's recommended to use it in conjunction
-  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
-  networking.useDHCP = lib.mkDefault true;
-  # networking.interfaces.wlp1s0f0.useDHCP = lib.mkDefault true;
-
-  nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
-  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
-}
diff --git a/nixos/kompakt/secrets/secrets.yaml b/nixos/kompakt/secrets/secrets.yaml
deleted file mode 100644
index f9d53ff..0000000
--- a/nixos/kompakt/secrets/secrets.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-root-password: ENC[AES256_GCM,data:YQnUoTGpz0JC1Ck3pPTkbHavcSAZJxVD9xvKYXQRmfIS27B9yz0TmLv0ozweb7qsvRAgO0m3tCO9rfIh+5qO3kGMG0h5OhP7dw==,iv:hFTEFEsOubYaWEu58xusBtT5c9K5sAcezKfVkCrtvrE=,tag:GZA6AVsFIdWjaGZe1c5aJQ==,type:str]
-sefidel-password: ENC[AES256_GCM,data:jphYVr3Wg8+1llflee0Hb2f2V6bgwq+uAoZ+ZTCHxh95vHRHGBSUYDDnMZdJr63hr9Kc+t/ZYRJpwmmxAbZqrFJAjCzuSrBqlKFY0AGRVhIvFg/jeZbocea+8T+Flpp/yQ5rMtJWIE5NSg==,iv:+3UCC8tCXVyyLmHDuxTTJpB6ufZoZUNvBwHb70S5iYc=,tag:44OdW9OFv9hibABsB4w6cw==,type:str]
-sops:
-    kms: []
-    gcp_kms: []
-    azure_kv: []
-    hc_vault: []
-    age:
-        - recipient: age1jt8xg0lvzj5q4f7fn7nw670qsszm3kv3caa654eh62azra4x44zss4fad8
-          enc: |
-            -----BEGIN AGE ENCRYPTED FILE-----
-            YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB1UkJnR2czcm90MHBoUUtE
-            Zi94UFJvRUlhbjhZMStUWlhUVzlXTE5MSkRvCjZOck9kWTBKMHhUai9kbklGVUF1
-            RTNESGZyZFVucGlDM2cxbUVPS0w5cjQKLS0tIGhDeFN2KzkzZTVmWHBVTFhScHBR
-            czFyOHArSHNpaGN2R1p5aDJjd2JEOWsKThjzyM88xKZPrMjLOzrS7q2GQzS9+Xl/
-            df1X1guIS3i7fwjc9DuvaDlnuz3QpIwOQ1/1M8NR/gjBfYRJ+0pLcw==
-            -----END AGE ENCRYPTED FILE-----
-        - recipient: age180yj8dn9jhjzj9c0y6qr5fa76g0ls3p772dvn60nu67wveqv8pvsahvur6
-          enc: |
-            -----BEGIN AGE ENCRYPTED FILE-----
-            YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBHNlVqOGFYUEl2TVR5dlBp
-            aVRUSjhjYXBVVFVZaTlWN0hiblVvSXhMWFV3Ci9haDA1V0w1MjYwSThyU25ia3NJ
-            L1htVTZnUGRPakQyQUVxbzJYWmxvblEKLS0tIGFOSTZ3cmI0NnBxdzl3N2dvUW92
-            bjJCVUJDMm50V3pwaU1zQkUwRXdpdjAK39fVzMaVj7WRv7CcrTTrWyaSqohVZ59Z
-            coo75mzw8ImC8Evk1ZqkOAjmN4FbXrsWnpF+pLp17fsqbINkQM3QvA==
-            -----END AGE ENCRYPTED FILE-----
-    lastmodified: "2023-02-20T07:26:03Z"
-    mac: ENC[AES256_GCM,data:xH89h6MC0LNk8RkxDGrp0m92PZcjBWI0itMCS1OoHKEo+pRNYVVlQT4sqKyY5SWs1UAKKhF/Ks7jHNtAHFvo7gxw56mziYXhtnOTV3uzxLkVmhOH1qkma+4eztwVdLzBny9v9MtqCWdVdEPnCgeJfM3lLCEuT/Rif/b3wdnLcwQ=,iv:7K+xpkjUtxCEhplksrxl73GbMtzQM6YIFdGJQELGUOQ=,tag:UoTyR1rlEEMsg0/SCclfUg==,type:str]
-    pgp: []
-    unencrypted_suffix: _unencrypted
-    version: 3.7.3