dotfiles

My PC Dotfiles & Website
commit 223e4e2b880d8f0780a1ed55aa1344f34425d3e5
parent 11b2cb6fac5cfa8c7a906b3ce430f98885d3bbb9
Author: maydayv7 <maydayv7@gmail.com>
Date:   Mon, 14 Oct 2024 17:47:50 +0530

refactor(ci): ISO Build

Build monthly and upload image as Github artifact to circumvent size limit
Also fix install media

Diffstat:

A.github/workflows/iso.yml | 36++++++++++++++++++++++++++++++++++++
D.github/workflows/release.yml | 35-----------------------------------
MREADME.md | 7++++---
Mdevices/flake.nix | 2+-
Mmodules/apps/default.nix | 1+
Mmodules/base/default.nix | 2+-
Mmodules/gui/default.nix | 24++++++++++++++++--------
Mmodules/gui/desktop/gnome/iso.nix | 14+++-----------
Mmodules/gui/desktop/xfce/iso.nix | 17++++++-----------
Mmodules/gui/theme.nix | 2+-
Mmodules/hardware/default.nix | 1+
Mmodules/nix/default.nix | 2+-
Mmodules/shell/default.nix | 2+-
Mmodules/user/default.nix | 2+-
14 files changed, 73 insertions(+), 74 deletions(-)

diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml @@ -0,0 +1,36 @@ +name: "ci: Build default `installMedia`" +on: + workflow_dispatch: + schedule: + - cron: "0 0 1 * *" + push: + tags: + - "*" +env: + NIX_SHOW_STATS: 1 +jobs: + image: + runs-on: ubuntu-latest + steps: + - name: Clone Repo + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + - name: Install Nix + uses: cachix/install-nix-action@v30 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Build Default Install Media + run: nix build .#installMedia.default.config.system.build.isoImage -L --show-trace + - name: Upload ISO Image + uses: actions/upload-artifact@v4 + id: image-upload + with: + name: Image + path: result/iso/nixos.iso + compression-level: 0 + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml @@ -1,35 +0,0 @@ -name: "ci: Create Release" -on: - push: - tags: - - "*" -env: - NIX_SHOW_STATS: 1 -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Clone Repo - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - name: Install Nix - uses: cachix/install-nix-action@v30 - with: - extra_nix_config: | - experimental-features = nix-command flakes - accept-flake-config = true - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Build Default Install Media - run: nix build .#installMedia.default.config.system.build.isoImage -L --show-trace - - name: Draft Release - uses: ncipollo/release-action@v1.14.0 - with: - allowUpdates: true - artifactErrorsFailBuild: true - artifacts: "result/iso/nixos.iso" - draft: true - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md @@ -288,7 +288,7 @@ Example `flake.nix`: timezone = "Continent/City"; locale = "US"; - kernel = "zen"; + kernel = "zfs"; kernelModules = ["nvme"]; gui = {}; @@ -316,7 +316,7 @@ Example `flake.nix`: <details> <summary><b>From Scratch</b></summary> -Download the latest NixOS `.iso` from the [Releases](../../releases/latest) page and burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/) +Download the latest install media image from the [Releases](../../releases/latest) page and burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/) > [!IMPORTANT] > These instructions are mainly intended for personal use. @@ -391,7 +391,7 @@ It is not recommended to use NixOS if you are a beginner just starting out, with _May change according to available hardware_ -This configuration works well with an Intel CPU + iGPU, and is currently being improved to support AMD CPU + iGPU + Nvidia GPU. Any other setup is untested +This configuration works well with an Intel CPU + iGPU, and is currently being improved to support AMD APU + Nvidia GPU. Any other setup is untested The `hardware.modules` option can be used to load relevant configuration from [`nixos-hardware`](https://github.com/nixos/nixos-hardware) See [this](./modules/hardware/README.md) for additional information @@ -526,6 +526,7 @@ You can navigate to the `README`s present in the various directories to know mor - Add configuration for Spotify using [`spicetify-nix`](https://github.com/Gerg-L/spicetify-nix) - Make VS Code Configuration mutable using [this](https://gist.github.com/piousdeer/b29c272eaeba398b864da6abf6cb5daa) module - Reimplement support for specifying Package Channel for configuration build +- Refactor Install Media build and upload image as Github artifact to circumvent size limit ### v17 diff --git a/devices/flake.nix b/devices/flake.nix @@ -36,7 +36,7 @@ in { password = readFile ../users/passwords/default; }; })) (import ../modules/gui/desktop/iso.nix)) - // {default = self.installMedia.xfce;}; + // {default = self.installMedia.gnome;}; ## Virtual Machines ## vmConfigurations = with self; diff --git a/modules/apps/default.nix b/modules/apps/default.nix @@ -6,6 +6,7 @@ inherit (util.map) modules; inherit (lib) mkOption types; in { + ## APPS Configuration ## imports = modules.list ./.; options.apps.list = mkOption { diff --git a/modules/base/default.nix b/modules/base/default.nix @@ -11,6 +11,7 @@ inherit (lib) removePrefix mkIf mkOption optionals types; cfg = config.base; in { + ## BASE Configuration ## imports = util.map.modules.list ./. ++ [inputs.generators.nixosModules.all-formats]; options.base = { @@ -30,7 +31,6 @@ in { }; }; - ## Base Configuration ## config = { # Kernel Configuration boot = { diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -3,13 +3,15 @@ options, lib, util, + pkgs, ... }: let inherit (builtins) map; inherit (util.map.modules) list name; - inherit (lib) hasSuffix mkEnableOption mkIf mkOption optional types; + inherit (lib) hasSuffix mkEnableOption mkForce mkIf mkMerge mkOption optional types; inherit (config.gui) desktop; in { + ## GUI Configuration ## imports = list ./. ++ list ./desktop; options.gui = { @@ -28,12 +30,11 @@ in { }; }; - config = - { - # Warning - warnings = optional (desktop == "") (options.gui.desktop.description + " is unset"); - } - // (mkIf (desktop != "" && !(hasSuffix "-iso" desktop)) + config = mkMerge [ + {warnings = optional (desktop == "") (options.gui.desktop.description + " is unset");} + + ## Desktop Environment + (mkIf (desktop != "" && !(hasSuffix "-iso" desktop)) { # Autostart Apps user.persist.directories = [".config/autostart"]; @@ -51,5 +52,12 @@ in { enable = true; xdgOpenUsePortal = true; }; - }); + }) + + ## Install Media + (mkIf (hasSuffix "-iso" desktop) { + xdg.portal.enable = mkForce false; + environment.systemPackages = with pkgs; [epiphany gparted]; + }) + ]; } diff --git a/modules/gui/desktop/gnome/iso.nix b/modules/gui/desktop/gnome/iso.nix @@ -20,18 +20,13 @@ in { # Essential Utilities environment.systemPackages = with (pkgs.gnome // pkgs); [ - epiphany gnome-console gnome-text-editor gnome-system-monitor - gparted nautilus ]; # Excluded Packages - xdg.portal.enable = mkForce false; - qt.enable = mkForce false; - services.gnome = { core-utilities.enable = mkForce false; gnome-browser-connector.enable = mkForce false; @@ -39,11 +34,8 @@ in { gnome-user-share.enable = mkForce false; }; - environment.gnome.excludePackages = with pkgs.gnome; [ - gnome-backgrounds - gnome-shell-extensions - pkgs.gnome-tour - pkgs.gnome-user-docs - pkgs.hicolor-icon-theme + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + hicolor-icon-theme ]; } diff --git a/modules/gui/desktop/xfce/iso.nix b/modules/gui/desktop/xfce/iso.nix @@ -5,17 +5,12 @@ }: let inherit (lib) mkForce; in { - environment = { - # Utilities - systemPackages = with pkgs; [epiphany gparted]; - - # Excluded Packages - xfce.excludePackages = with (pkgs.xfce // pkgs); [ - tango-icon-theme - xfce4-icon-theme - xfwm4-themes - ]; - }; + # Excluded Packages + environment.xfce.excludePackages = with (pkgs.xfce // pkgs); [ + tango-icon-theme + xfce4-icon-theme + xfwm4-themes + ]; # Disabled Services services.tumbler.enable = mkForce false; diff --git a/modules/gui/theme.nix b/modules/gui/theme.nix @@ -8,7 +8,7 @@ }: let inherit (lib) attrNames hasSuffix mkIf mkOption optionals types; cfg = config.gui; - enable = !(cfg.desktop == "" || hasSuffix "-minimal" cfg.desktop); + enable = !(cfg.desktop == "" || hasSuffix "-iso" cfg.desktop); exists = app: builtins.elem app config.apps.list; in { imports = [inputs.stylix.nixosModules.stylix]; diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix @@ -9,6 +9,7 @@ inherit (lib) mkForce mkOption types; cfg = config.hardware; in { + ## HARDWARE Configuration ## imports = modules.list ./.; options.hardware = with types; { diff --git a/modules/nix/default.nix b/modules/nix/default.nix @@ -1,7 +1,7 @@ {pkgs, ...}: { + ## NIX Configuration ## imports = [./index.nix ./registry.nix ./tools.nix]; - ## Nix Settings ## config = { # Settings user.persist.directories = [".cache/nix"]; diff --git a/modules/shell/default.nix b/modules/shell/default.nix @@ -11,11 +11,11 @@ with files; let inherit (builtins) listToAttrs map; inherit (lib) getExe' mkEnableOption mkBefore mkIf mkMerge nameValuePair; in { + ## SHELL Configuration ## imports = modules.list ./.; options.shell.utilities = mkEnableOption "Enable Additional Shell Utilities"; - ## Shell Configuration ## config = mkMerge [ { # Environment Settings diff --git a/modules/user/default.nix b/modules/user/default.nix @@ -30,6 +30,7 @@ merge = _: getValues; }; in { + ## USER Configuration ## imports = modules.list ./. ++ [inputs.home-manager.nixosModules.home-manager]; options = { @@ -113,7 +114,6 @@ in { }; }; - ## User Configuration ## config = { # Settings users = {