From b7ecc2984dcd8c5f560d69dc421de907a9eebccd Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Mon, 1 May 2023 19:59:25 +0200 Subject: [PATCH] added own iso --- .gitignore | 1 + README.md | 3 +++ flake.lock | 6 +++--- flake.nix | 16 +++++++++++++--- hosts/iso/default.nix | 18 ++++++++++++++++++ hosts/iso/zsh.nix | 30 ++++++++++++++++++++++++++++++ hosts/thinkpad/default.nix | 2 +- shared/zsh.nix | 3 +++ users/rouven/modules/packages.nix | 1 + 9 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 hosts/iso/default.nix create mode 100644 hosts/iso/zsh.nix diff --git a/.gitignore b/.gitignore index 1377554..4cc9af5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +result diff --git a/README.md b/README.md index b05b79c..7147359 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,6 @@ sda ### vm Barebones configuration that can be easily deployed to virtual machines. + +### iso +My custom installer and rescue image containing some personal tweaks. diff --git a/flake.lock b/flake.lock index 7f18c42..8aae1e9 100644 --- a/flake.lock +++ b/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1682906023, - "narHash": "sha256-u0ngImxdfv2oSxFsjcfoQx6G2haZociXB5jHovEO1w8=", + "lastModified": 1682951948, + "narHash": "sha256-w+auHu4yyZrt93zI/xyrgYrpXlDPmVfKL3Fs9DoF4fQ=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "11b7ce14f87448417ce39cb667df6c6b9a591804", + "rev": "45b1e6dc5ee42b01a377bd875181bc621c72f914", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 35d438c..a3baf12 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,5 @@ { - description = "My nix setup"; - inputs = { + description = "My nix setup"; inputs = { nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; @@ -64,7 +63,8 @@ }; outputs = - { nixpkgs + { self + , nixpkgs , home-manager , nix-index-database , impermanence @@ -76,6 +76,7 @@ , trucksimulatorbot-images , ... }@attrs: { + packages.x86_64-linux.default = self.nixosConfigurations.iso.config.system.build.isoImage; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; nixosConfigurations = { thinkpad = nixpkgs.lib.nixosSystem { @@ -135,6 +136,15 @@ sops-nix.nixosModules.sops ]; }; + iso = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs.inputs = attrs; + modules = [ + ./hosts/iso + ./shared/caches.nix + ./shared/vim.nix + ]; + }; }; }; } diff --git a/hosts/iso/default.nix b/hosts/iso/default.nix new file mode 100644 index 0000000..6986d17 --- /dev/null +++ b/hosts/iso/default.nix @@ -0,0 +1,18 @@ +{ config, lib, modulesPath, ... }: +{ + imports = [ + "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" + ./zsh.nix + ]; + + console = { + font = "Lat2-Terminus16"; + keyMap = "dvorak"; + }; + programs.git.enable = true; + + # in case we need to rescue a zfs machine + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + + +} diff --git a/hosts/iso/zsh.nix b/hosts/iso/zsh.nix new file mode 100644 index 0000000..b10b827 --- /dev/null +++ b/hosts/iso/zsh.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +{ + programs.command-not-found.enable = false; + environment.systemPackages = with pkgs; [ + fzf + ]; + users.defaultUserShell = pkgs.zsh; + programs.zsh = { + enable = true; + autosuggestions = { + enable = true; + highlightStyle = "fg=#00bbbb,bold"; + }; + + shellInit = + '' + source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh + zsh-newuser-install () {} + + ''; + + # Hacky way to bind Ctrl+R to fzf. Otherwise it will be overridden + promptInit = + '' + source ${pkgs.fzf}/share/fzf/completion.zsh + source ${pkgs.fzf}/share/fzf/key-bindings.zsh + ''; + }; +} + diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index ad17370..cc0feed 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -20,7 +20,7 @@ }; nix.settings = { - cores = 6; # don't clutter the whole system when compiling stuff + # cores = 6; # don't clutter the whole system when compiling stuff auto-optimise-store = true; }; diff --git a/shared/zsh.nix b/shared/zsh.nix index 2830ada..ea3c14f 100644 --- a/shared/zsh.nix +++ b/shared/zsh.nix @@ -53,6 +53,9 @@ then cat ${../images/cat.sixel} fi + + zsh-newuser-install () {} + ''; # Hacky way to bind Ctrl+R to fzf. Otherwise it will be overridden diff --git a/users/rouven/modules/packages.nix b/users/rouven/modules/packages.nix index 052a56d..acca3ef 100644 --- a/users/rouven/modules/packages.nix +++ b/users/rouven/modules/packages.nix @@ -54,6 +54,7 @@ ventoy xsane # scanning jetbrains.idea-community + nix-output-monitor ripgrep # better grep duf # better df