]> Untitled Git - monorepo.git/commitdiff
big update; fix vps and streamline some stuff
authorPreston Pan <ret2pop@gmail.com>
Sun, 7 Sep 2025 07:37:22 +0000 (00:37 -0700)
committerPreston Pan <ret2pop@gmail.com>
Sun, 7 Sep 2025 07:37:22 +0000 (00:37 -0700)
14 files changed:
about.org
config/nix.org
index.org
nix/disko/vda-simple.nix
nix/flake.nix
nix/modules/configuration.nix
nix/modules/home/default.nix
nix/modules/home/fcitx.nix
nix/modules/home/user.nix
nix/modules/home/zsh.nix
nix/modules/xserver.nix
nix/systems/installer/commits.nix
nix/systems/installer/default.nix
nix/systems/spontaneity/default.nix

index 92bc99eecad764228b81f86b86aa5c077948a597..833abfd2ca1d503b97fad1ac0ba269d59761ebe6 100644 (file)
--- a/about.org
+++ b/about.org
@@ -52,8 +52,3 @@ This is for all my public keys that are important. Note: for cryptocurrency publ
 public scanner to get my public keys.
 - This is [[file:public-key.asc][my gpg public key for ret2pop]].
 - This is [[file:id_ed25519.pub][my ssh key]].
-
-* Feeds
-RSS (and Atom feeds) are ways of keeping up-to-date in a minimal and universal way.
-- [[https://git.nullring.xyz/ret2pop-website.git/?format=atom][Website Cgit repo atom feed]]
-
index eafb10e0b04125a50e39d9d519733b45bb0dbd75..e34d1f53ccafac31694a74cf37155a29014208f0 100644 (file)
@@ -55,6 +55,13 @@ so that adding new configurations that add modifications is made simple.
 
     outputs = { self, nixpkgs, home-manager, nur, disko, lanzaboote, sops-nix, nix-topology, nixos-dns, deep-research, ... }@attrs:
       let
+        hostnames = [
+          "affinity"
+          "continuity"
+          "installer"
+          "spontaneity"
+          # add hostnames here
+        ];
         system = "x86_64-linux";
         pkgs = import nixpkgs { inherit system; };
         generate = nixos-dns.utils.generate nixpkgs.legacyPackages."${system}";
@@ -62,8 +69,7 @@ so that adding new configurations that add modifications is made simple.
           inherit (self) nixosConfigurations;
           extraConfig = import ./dns/default.nix;
         };
-        mkConfigs = map (hostname: {
-          name = "${hostname}";
+        mkConfigs = map (hostname: {name = "${hostname}";
           value = nixpkgs.lib.nixosSystem {
             inherit system;
             specialArgs = attrs;
@@ -74,7 +80,7 @@ so that adding new configurations that add modifications is made simple.
             ] else [
               {
                 environment.systemPackages = with nixpkgs.lib; [
-                  deep-research.packages.${system}.deep-research
+                  deep-research.packages."${system}".deep-research
                 ];
               }
               nix-topology.nixosModules.default
@@ -85,7 +91,7 @@ so that adding new configurations that add modifications is made simple.
               nixos-dns.nixosModules.dns
               {
                 nixpkgs.overlays = [ nur.overlays.default ];
-                home-manager.extraSpecialArgs = attrs;
+                home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
                 networking.hostName = "${hostname}";
               }
               (./. + "/systems/${hostname}/default.nix")
@@ -94,12 +100,7 @@ so that adding new configurations that add modifications is made simple.
         });
       in {
         # add new systems here
-        nixosConfigurations = builtins.listToAttrs (mkConfigs [
-          "affinity"
-          "continuity"
-          "installer"
-          "spontaneity"
-        ]);
+        nixosConfigurations = builtins.listToAttrs (mkConfigs hostnames);
 
         topology."${system}" = import nix-topology {
           pkgs = import nixpkgs {
@@ -347,9 +348,9 @@ Still, it is suitable for using Krita.
   { lib, config, pkgs, ... }:
   {
     services.xserver = {
-      enable = lib.mkDefault true;
+      enable = (! config.monorepo.profiles.ttyonly.enable);
       displayManager = {
-        startx.enable = true;
+        startx.enable = (! config.monorepo.profiles.ttyonly.enable);
       };
 
       windowManager = {
@@ -933,7 +934,7 @@ because they enhance security.
 
       loader = {
          systemd-boot.enable = lib.mkForce (! config.monorepo.profiles.grub.enable);
-         efi.canTouchEfiVariables = lib.mkDefault (! config.monorepo.profiles.grub.enable);
+         efi.canTouchEfiVariables = lib.mkForce (! config.monorepo.profiles.grub.enable);
       };
 
       kernelModules = [
@@ -1128,7 +1129,7 @@ because they enhance security.
 
       auditd.enable = true;
       audit.enable = true;
-      chromiumSuidSandbox.enable = true;
+      chromiumSuidSandbox.enable = (! config.monorepo.profiles.ttyonly.enable);
       sudo.enable = true;
     };
 
@@ -1242,41 +1243,41 @@ This is the disko configuration for my continuity system. It features a boot and
 on disk /dev/sda. All my SATA disks have this location by default, but if you want to use nvme,
 you will have to import that configuration in your ~systems/xxx/default.nix~.
 #+begin_src nix :tangle ../nix/disko/sda-simple.nix
-{
-  disko.devices = {
-    disk = {
-      my-disk = {
-        device = "/dev/sda";
-        type = "disk";
-        content = {
-          type = "gpt";
-          partitions = {
-            ESP = {
-              type = "EF00";
-              size = "500M";
-              priority = 1;
-              content = {
-                type = "filesystem";
-                format = "vfat";
-                mountpoint = "/boot";
-                mountOptions = [ "umask=0077" ];
+  {
+    disko.devices = {
+      disk = {
+        my-disk = {
+          device = "/dev/sda";
+          type = "disk";
+          content = {
+            type = "gpt";
+            partitions = {
+              ESP = {
+                type = "EF00";
+                size = "500M";
+                priority = 1;
+                content = {
+                  type = "filesystem";
+                  format = "vfat";
+                  mountpoint = "/boot";
+                  mountOptions = [ "umask=0077" ];
+                };
               };
-            };
-            root = {
-              size = "100%";
-              priority = 2;
-              content = {
-                type = "filesystem";
-                format = "ext4";
-                mountpoint = "/";
+              root = {
+                size = "100%";
+                priority = 2;
+                content = {
+                  type = "filesystem";
+                  format = "ext4";
+                  mountpoint = "/";
+                };
               };
             };
           };
         };
       };
     };
-  };
-}
+  }
 #+end_src
 *** NVME
 For my nvme drives.
@@ -1334,6 +1335,7 @@ For my virtual machines.
                 type = "EF02";
               };
               root = {
+                label = "disk-main-root"; 
                 size = "100%";
                 content = {
                   type = "filesystem";
@@ -1530,26 +1532,26 @@ I have many imports that we'll go through next.
 
       monorepo.profiles = {
            enable = lib.mkDefault true;
-           music.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           hyprland.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           email.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
+           music.enable = lib.mkDefault config.monorepo.profiles.enable;
+           hyprland.enable = lib.mkDefault config.monorepo.profiles.enable;
+           email.enable = lib.mkDefault config.monorepo.profiles.enable;
 
            # Programming
-        graphics.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-c.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-rust.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-python.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-sol.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-sh.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-openscad.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-js.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-nix.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-coq.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-haskell.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-
-           crypto.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           art.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           workstation.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
+        graphics.enable = lib.mkDefault  config.monorepo.profiles.enable;
+           lang-c.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-rust.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-python.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-sol.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-sh.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-openscad.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-js.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-nix.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-coq.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-haskell.enable = lib.mkDefault config.monorepo.profiles.enable;
+
+           crypto.enable = lib.mkDefault config.monorepo.profiles.enable;
+           art.enable = lib.mkDefault config.monorepo.profiles.enable;
+           workstation.enable = lib.mkDefault config.monorepo.profiles.enable;
       };
     };
   }
@@ -1829,19 +1831,20 @@ be straightforward.
 *** Fcitx
 This is a virtual keyboard program for writing in multiple languages. I use this sometimes.
 #+begin_src nix :tangle ../nix/modules/home/fcitx.nix
-{ pkgs, ... }:
-{
-  i18n.inputMethod = {
-    enabled = "fcitx5";
-    fcitx5.addons = with pkgs; [
-      fcitx5-gtk
-      fcitx5-chinese-addons
-      fcitx5-configtool
-      fcitx5-mozc
-      fcitx5-rime
-    ];
-  };
-}
+  { config, pkgs, lib, ... }:
+  {
+    i18n.inputMethod = {
+      type = "fcitx5";
+      enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
+      fcitx5.addons = with pkgs; [
+        fcitx5-gtk
+        fcitx5-chinese-addons
+        fcitx5-configtool
+        fcitx5-mozc
+        fcitx5-rime
+      ];
+    };
+  }
 #+end_src
 Note that I configure fcitx with chinese and some japanese input enabled.
 *** Emacs
@@ -2892,7 +2895,7 @@ A classic program that allows you to download from youtube. Also has integration
 My zsh config has some useful aliases that one should read through. Otherwise it is pretty
 standard.
 #+begin_src nix :tangle ../nix/modules/home/zsh.nix
-  { lib, config, pkgs, ... }:
+  { lib, config, pkgs, systemHostName, ... }:
   {
     programs.zsh = {
       enable = true;
@@ -2919,8 +2922,7 @@ standard.
         g = "git";
         v = "vim";
         py = "python3";
-        rb = "sudo nixos-rebuild switch --flake .#continuity";
-        rba = "sudo nixos-rebuild switch --flake .#affinity";
+        rb = "sudo nixos-rebuild switch --flake .#${systemHostName}";
         nfu = "cd ~/monorepo/nix && git add . && git commit -m \"new flake lock\" &&  nix flake update";
         usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
         usite
@@ -3069,7 +3071,6 @@ for these configurations.
     };
 
     fonts.fontconfig.enable = true;
-    nixpkgs.config.cudaSupport = lib.mkDefault config.monorepo.profiles.cuda.enable;
   }
 #+end_src
 * Systems
@@ -3167,6 +3168,8 @@ Spontaneity is my VPS instance.
           grub.enable = true;
         };
       };
+
+      boot.loader.grub.device = "nodev";
       networking = {
         firewall.allowedTCPPorts = [
           80
@@ -3196,6 +3199,7 @@ Spontaneity is my VPS instance.
             "mail.${config.monorepo.vars.remoteHost}" = {};
 
             "nullring.xyz" = {};
+            "git.nullring.xyz" = {};
             "matrix.nullring.xyz" = {};
             "talk.nullring.xyz" = {};
             "mail.nullring.xyz" = {};
@@ -3227,6 +3231,7 @@ work deterministically.
   {
     diskoCommitHash = "a5c4f2ab72e3d1ab43e3e65aa421c6f2bd2e12a1";
     monorepoCommitHash = "af3c15c43c65fd77aab441f4c657aeaa74cc67d5";
+    monorepoUrl = "https://github.com/ret2pop/monorepo";
   }
 #+end_src
 *** ISO Default Profile
@@ -3284,12 +3289,21 @@ This contains the installation script I use to install my systems.
     exit 1
   fi
 
-  if [ -z "$SYSTEM" ]; then
-      SYSTEM=continuity
+  gum style --border normal --margin "1" --padding "1 2" "Choose a system to install or select `new` in order to create a new system."
+
+  SYSTEM="$(gum choose "$(find "$HOME/monorepo/nix/systems" -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | grep -v -E 'installer'; printf "New")")"
+
+  if [[ "$SYSTEM" == "New" ]]; then
+    gum style --border normal --margin "1" --padding "1 2" "Choose a system name"
+    SYSTEM="$(gum input --placeholder "system name")"
   fi
 
-  if [ -z "$DRIVE" ]; then
-      DRIVE=sda-simple
+  gum style --border normal --margin "1" --padding "1 2" "Select a drive file or create a new drive file."
+  DRIVE="$(gum choose "$(find "$HOME/monorepo/nix/disko" -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | printf "New")")"
+
+  if [[ "$DRIVE" == "New" ]]; then
+    gum style --border normal --margin "1" --padding "1 2" "Choose a name to call your drive file."
+    SYSTEM="$(gum input --placeholder "drive file name (ex: my_sda.nix)")"
   fi
 
   ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installation..." || nmtui
@@ -3297,9 +3311,10 @@ This contains the installation script I use to install my systems.
   cd "$HOME"
 
   if [ ! -d "$HOME/monorepo/" ]; then
-    git clone https://git.nullring.xyz/monorepo.git
-    cd monorepo
+    git clone ${commits.monorepoUrl}
+    cd "$HOME/monorepo"
     git checkout "${commits.monorepoCommitHash}"
+    cd "$HOME"
   fi
 
 
@@ -3311,7 +3326,7 @@ This contains the installation script I use to install my systems.
   {
     imports = [
       ../../modules/default.nix
-      ../../disko/$DRIVE.nix
+      ../../disko/$DRIVE
       ../home.nix
     ];
   }
@@ -3321,17 +3336,21 @@ This contains the installation script I use to install my systems.
     gum input --placeholder "Press Enter to continue" >/dev/null
     vim "$HOME/monorepo/nix/systems/$SYSTEM/default.nix"
 
-    sed -i "/mkConfigs \[/,/\]/ s/^\(\s*\)\]/\1  \"$SYSTEM\"\n\1]/" "$HOME/monorepo/nix/flake.nix"
-  fi
+    sed -i "/hostnames = \[/,/];/ { /];/i \        \"your-hostname-$SYSTEM\" }" "$HOME/monorepo/nix/flake.nix"
 
-  if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE.nix" ]; then
-    cp "$HOME/monorepo/nix/disko/sda-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE.nix"
-    gum style --border normal --margin "1" --padding "1 2" "Edit the drive file with your preferred partitioning scheme."
-    gum input --placeholder "Press Enter to continue" >/dev/null
-    vim "$HOME/monorepo/nix/disko/$DRIVE.nix"
+    if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
+      cp "$HOME/monorepo/nix/disko/sda-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE"
+      gum style --border normal --margin "1" --padding "1 2" "Edit the drive file with your preferred partitioning scheme."
+      gum input --placeholder "Press Enter to continue" >/dev/null
+      vim "$HOME/monorepo/nix/disko/$DRIVE"
+    fi
+    cd "$HOME/monorepo" && git add . && cd "$HOME"
   fi
 
-  cd "$HOME/monorepo" && git add . && cd "$HOME"
+  if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
+    echo "error: you should create a new system if you use a drive file that is not in the repo."
+    exit 1
+  fi
 
   gum style --border normal --margin "1" --padding "1 2" "Formatting the drive is destructive!"
   if gum confirm "Are you sure you want to continue?"; then
@@ -3341,7 +3360,7 @@ This contains the installation script I use to install my systems.
       exit 1
   fi
 
-  sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/disko/$DRIVE.nix"
+  sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/disko/$DRIVE"
   cd /mnt
   sudo nixos-install --flake "$HOME/monorepo/nix#$SYSTEM"
 
index 08798b27b693806eafb75be0470627ccf987da08..7d3ef8a08e20e93e60d6bb5ac4d58651fa718aff 100644 (file)
--- a/index.org
+++ b/index.org
@@ -52,7 +52,7 @@ can therefore publish them. So I did! Configurations include:
 - Qutebrowser
 â€¦and many more!
 * [[https://git.nullring.xyz][Projects]]
-My programming projects can be found on my git server; other projects that do not directly pertain
+My programming projects can be found on my [[https://ret2pop.net/gitweb][git server]]; other projects that do not directly pertain
 to my projects on git or need a more in-depth explanation are explained further in my blog.
 I also have a [[https://github.com/ret2pop][github]] for those interested.
 * [[https://youtube.com/@ret2pop][Music and Media]]
index 32fa28d068cdcb658be0ccfabd6eb5a01ac0b7e9..3ae1d34ff972325e0bd0526bb6144042dcef1890 100644 (file)
@@ -12,6 +12,7 @@
               type = "EF02";
             };
             root = {
+              label = "disk-main-root"; 
               size = "100%";
               content = {
                 type = "filesystem";
index 4b08aa98a633ac56c102476d7907031623fd2004..021bcce7ab780372dc967dd4b0d6c9b20e8f310e 100644 (file)
 
   outputs = { self, nixpkgs, home-manager, nur, disko, lanzaboote, sops-nix, nix-topology, nixos-dns, deep-research, ... }@attrs:
     let
+      hostnames = [
+        "affinity"
+        "continuity"
+        "installer"
+        "spontaneity"
+        # add hostnames here
+      ];
       system = "x86_64-linux";
       pkgs = import nixpkgs { inherit system; };
       generate = nixos-dns.utils.generate nixpkgs.legacyPackages."${system}";
@@ -42,8 +49,7 @@
         inherit (self) nixosConfigurations;
         extraConfig = import ./dns/default.nix;
       };
-      mkConfigs = map (hostname: {
-        name = "${hostname}";
+      mkConfigs = map (hostname: {name = "${hostname}";
         value = nixpkgs.lib.nixosSystem {
           inherit system;
           specialArgs = attrs;
@@ -54,7 +60,7 @@
           ] else [
             {
               environment.systemPackages = with nixpkgs.lib; [
-                deep-research.packages.${system}.deep-research
+                deep-research.packages."${system}".deep-research
               ];
             }
             nix-topology.nixosModules.default
@@ -65,7 +71,7 @@
             nixos-dns.nixosModules.dns
             {
               nixpkgs.overlays = [ nur.overlays.default ];
-              home-manager.extraSpecialArgs = attrs;
+              home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
               networking.hostName = "${hostname}";
             }
             (./. + "/systems/${hostname}/default.nix")
       });
     in {
       # add new systems here
-      nixosConfigurations = builtins.listToAttrs (mkConfigs [
-        "affinity"
-        "continuity"
-        "installer"
-        "spontaneity"
-      ]);
+      nixosConfigurations = builtins.listToAttrs (mkConfigs hostnames);
 
       topology."${system}" = import nix-topology {
         pkgs = import nixpkgs {
index 5439682445216d6e88b12fca950cb17af4cde436..caeb1f7803f21b4641cf7b58c1cc4292a4c279f7 100644 (file)
@@ -78,7 +78,7 @@
 
     loader = {
          systemd-boot.enable = lib.mkForce (! config.monorepo.profiles.grub.enable);
-         efi.canTouchEfiVariables = lib.mkDefault (! config.monorepo.profiles.grub.enable);
+         efi.canTouchEfiVariables = lib.mkForce (! config.monorepo.profiles.grub.enable);
     };
 
     kernelModules = [
 
     auditd.enable = true;
     audit.enable = true;
-    chromiumSuidSandbox.enable = true;
+    chromiumSuidSandbox.enable = (! config.monorepo.profiles.ttyonly.enable);
     sudo.enable = true;
   };
 
index 614373baa4314523d2460a3b2237fa2e8ff7b2b7..52174a99243ca727df1c5e88f35d0bd4afe48127 100644 (file)
 
     monorepo.profiles = {
            enable = lib.mkDefault true;
-           music.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           hyprland.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           email.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
+           music.enable = lib.mkDefault config.monorepo.profiles.enable;
+           hyprland.enable = lib.mkDefault config.monorepo.profiles.enable;
+           email.enable = lib.mkDefault config.monorepo.profiles.enable;
 
            # Programming
-      graphics.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-c.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-rust.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-python.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-sol.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-sh.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-openscad.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-js.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-nix.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-coq.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           lang-haskell.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
+      graphics.enable = lib.mkDefault  config.monorepo.profiles.enable;
+           lang-c.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-rust.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-python.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-sol.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-sh.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-openscad.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-js.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-nix.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-coq.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-haskell.enable = lib.mkDefault config.monorepo.profiles.enable;
 
-           crypto.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           art.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
-           workstation.enable = lib.mkDefault (true && config.monorepo.profiles.enable);
+           crypto.enable = lib.mkDefault config.monorepo.profiles.enable;
+           art.enable = lib.mkDefault config.monorepo.profiles.enable;
+           workstation.enable = lib.mkDefault config.monorepo.profiles.enable;
     };
   };
 }
index 05dd8f74369873a06ae9481ff070ee6fab1bf2af..bedfdf2656a3678a09a7f1cc10f99ad9e280748a 100644 (file)
@@ -1,7 +1,8 @@
-{ pkgs, ... }:
+{ config, pkgs, lib, ... }:
 {
   i18n.inputMethod = {
-    enabled = "fcitx5";
+    type = "fcitx5";
+    enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
     fcitx5.addons = with pkgs; [
       fcitx5-gtk
       fcitx5-chinese-addons
index 0864baf9351ca4ba2e18a8585e032f0662226d21..1e88b75484461ebc18493d22b9c2cf5dc3512227 100644 (file)
@@ -104,5 +104,4 @@ nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-
   };
 
   fonts.fontconfig.enable = true;
-  nixpkgs.config.cudaSupport = lib.mkDefault config.monorepo.profiles.cuda.enable;
 }
index 31c76806a5062ecfafb63cec5e6c10912c7cb198..9f848bc1fc2d5e234ef813cc504f02d3b46c1e95 100644 (file)
@@ -1,4 +1,4 @@
-{ lib, config, pkgs, ... }:
+{ lib, config, pkgs, systemHostName, ... }:
 {
   programs.zsh = {
     enable = true;
@@ -25,8 +25,7 @@
       g = "git";
       v = "vim";
       py = "python3";
-      rb = "sudo nixos-rebuild switch --flake .#continuity";
-      rba = "sudo nixos-rebuild switch --flake .#affinity";
+      rb = "sudo nixos-rebuild switch --flake .#${systemHostName}";
       nfu = "cd ~/monorepo/nix && git add . && git commit -m \"new flake lock\" &&  nix flake update";
       usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
       usite
index aab138ddda295773be94a393e011b21a11d437db..0d5b29c3ca63e4d8b25f889f0dd9fc1bc6b59503 100644 (file)
@@ -1,9 +1,9 @@
 { lib, config, pkgs, ... }:
 {
   services.xserver = {
-    enable = lib.mkDefault true;
+    enable = (! config.monorepo.profiles.ttyonly.enable);
     displayManager = {
-      startx.enable = true;
+      startx.enable = (! config.monorepo.profiles.ttyonly.enable);
     };
 
     windowManager = {
index cf5d66ca51a7f62d0c80dd93e98b3391eaaa2ecb..bf865a3641236b4e73a6b1e398619c853147fcc3 100644 (file)
@@ -1,4 +1,5 @@
 {
   diskoCommitHash = "a5c4f2ab72e3d1ab43e3e65aa421c6f2bd2e12a1";
   monorepoCommitHash = "af3c15c43c65fd77aab441f4c657aeaa74cc67d5";
+  monorepoUrl = "https://github.com/ret2pop/monorepo";
 }
index 5541ecb62ddab5749bc0a69b0d561f0577e5f1e4..75f0b818a49d3c5f33695a2ba7538e348589dbd2 100644 (file)
@@ -50,12 +50,21 @@ if [ "$(id -u)" -eq 0 ]; then
   exit 1
 fi
 
-if [ -z "$SYSTEM" ]; then
-    SYSTEM=continuity
+gum style --border normal --margin "1" --padding "1 2" "Choose a system to install or select `new` in order to create a new system."
+
+SYSTEM="$(gum choose "$(find "$HOME/monorepo/nix/systems" -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | grep -v -E 'installer'; printf "New")")"
+
+if [[ "$SYSTEM" == "New" ]]; then
+  gum style --border normal --margin "1" --padding "1 2" "Choose a system name"
+  SYSTEM="$(gum input --placeholder "system name")"
 fi
 
-if [ -z "$DRIVE" ]; then
-    DRIVE=sda-simple
+gum style --border normal --margin "1" --padding "1 2" "Select a drive file or create a new drive file."
+DRIVE="$(gum choose "$(find "$HOME/monorepo/nix/disko" -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | printf "New")")"
+
+if [[ "$DRIVE" == "New" ]]; then
+  gum style --border normal --margin "1" --padding "1 2" "Choose a name to call your drive file."
+  SYSTEM="$(gum input --placeholder "drive file name (ex: my_sda.nix)")"
 fi
 
 ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installation..." || nmtui
@@ -63,9 +72,10 @@ ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installa
 cd "$HOME"
 
 if [ ! -d "$HOME/monorepo/" ]; then
-  git clone https://git.nullring.xyz/monorepo.git
-  cd monorepo
+  git clone ${commits.monorepoUrl}
+  cd "$HOME/monorepo"
   git checkout "${commits.monorepoCommitHash}"
+  cd "$HOME"
 fi
 
 
@@ -77,7 +87,7 @@ if [ ! -d "$HOME/monorepo/nix/systems/$SYSTEM" ]; then
 {
   imports = [
     ../../modules/default.nix
-    ../../disko/$DRIVE.nix
+    ../../disko/$DRIVE
     ../home.nix
   ];
 }
@@ -87,17 +97,21 @@ EOF
   gum input --placeholder "Press Enter to continue" >/dev/null
   vim "$HOME/monorepo/nix/systems/$SYSTEM/default.nix"
 
-  sed -i "/mkConfigs \[/,/\]/ s/^\(\s*\)\]/\1  \"$SYSTEM\"\n\1]/" "$HOME/monorepo/nix/flake.nix"
-fi
+  sed -i "/hostnames = \[/,/];/ { /];/i \        \"your-hostname-$SYSTEM\" }" "$HOME/monorepo/nix/flake.nix"
 
-if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE.nix" ]; then
-  cp "$HOME/monorepo/nix/disko/sda-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE.nix"
-  gum style --border normal --margin "1" --padding "1 2" "Edit the drive file with your preferred partitioning scheme."
-  gum input --placeholder "Press Enter to continue" >/dev/null
-  vim "$HOME/monorepo/nix/disko/$DRIVE.nix"
+  if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
+    cp "$HOME/monorepo/nix/disko/sda-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE"
+    gum style --border normal --margin "1" --padding "1 2" "Edit the drive file with your preferred partitioning scheme."
+    gum input --placeholder "Press Enter to continue" >/dev/null
+    vim "$HOME/monorepo/nix/disko/$DRIVE"
+  fi
+  cd "$HOME/monorepo" && git add . && cd "$HOME"
 fi
 
-cd "$HOME/monorepo" && git add . && cd "$HOME"
+if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
+  echo "error: you should create a new system if you use a drive file that is not in the repo."
+  exit 1
+fi
 
 gum style --border normal --margin "1" --padding "1 2" "Formatting the drive is destructive!"
 if gum confirm "Are you sure you want to continue?"; then
@@ -107,7 +121,7 @@ else
     exit 1
 fi
 
-sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/disko/$DRIVE.nix"
+sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/disko/$DRIVE"
 cd /mnt
 sudo nixos-install --flake "$HOME/monorepo/nix#$SYSTEM"
 
index 776149d894adc38fe6c6c43d48e095eff5b72b7a..3aa0a39b9285b16a12a60061272d64613ec38f3e 100644 (file)
@@ -15,6 +15,8 @@
         grub.enable = true;
       };
     };
+
+    boot.loader.grub.device = "nodev";
     networking = {
       firewall.allowedTCPPorts = [
         80
@@ -44,6 +46,7 @@
           "mail.${config.monorepo.vars.remoteHost}" = {};
 
           "nullring.xyz" = {};
+          "git.nullring.xyz" = {};
           "matrix.nullring.xyz" = {};
           "talk.nullring.xyz" = {};
           "mail.nullring.xyz" = {};