From 2969b161f02e710b25fc54404889aee1d09a5b72 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 8 Aug 2025 14:42:57 +0200 Subject: [PATCH 1/8] devvian --- home/alisceon.nix | 5 ++++- home/conf/config.nix | 1 + hosts/common.nix | 1 + hosts/electra/configuration.nix | 7 ++++++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 home/conf/config.nix diff --git a/home/alisceon.nix b/home/alisceon.nix index de08a09..506702a 100644 --- a/home/alisceon.nix +++ b/home/alisceon.nix @@ -16,7 +16,7 @@ ls = "exa"; ll = "exa -lah"; grep = "rg"; - cat = "bat"; + cat = "bat -p"; tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0"; # NixOS commands @@ -103,6 +103,9 @@ # overide broken config xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ./conf/obsidian.json; + # nixpkgs config + xdg.configFile."nixpkgs/config.nix".source = ./conf/config.nix; + home.packages = with pkgs; [ signal-desktop discord diff --git a/home/conf/config.nix b/home/conf/config.nix new file mode 100644 index 0000000..d84a323 --- /dev/null +++ b/home/conf/config.nix @@ -0,0 +1 @@ +{ allowUnfree = true; } \ No newline at end of file diff --git a/hosts/common.nix b/hosts/common.nix index 0fb51c4..f37ea05 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -121,6 +121,7 @@ krita edk2-uefi-shell obsidian + gparted ]; # end systemPackages gnome.excludePackages = with pkgs; [ evolution diff --git a/hosts/electra/configuration.nix b/hosts/electra/configuration.nix index d18d5e3..4a05eb3 100644 --- a/hosts/electra/configuration.nix +++ b/hosts/electra/configuration.nix @@ -18,7 +18,6 @@ enable = true; theme = "rings"; themePackages = with pkgs; [ - # By default we would install all themes (adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; }) @@ -49,4 +48,10 @@ tod.driver = pkgs.libfprint-2-tod1-goodix; }; }; + hardware = { + bluetooth = { + enable = true; + powerOnBoot = true; + }; + }; } From 183ff23447f11a1d59a8196a1da8147c2b38ec3d Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 8 Aug 2025 14:43:40 +0200 Subject: [PATCH 2/8] regress --- hosts/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/common.nix b/hosts/common.nix index f37ea05..91e947e 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -24,7 +24,7 @@ automatic = true; persistent = true; dates = "daily"; - options = "--delete-older-than 3d"; + options = "--delete-older-than 7d"; }; # end gc registry = { templates.to = { From 96057e337bbab839098fa865a68d7b78cf9e22c6 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 8 Aug 2025 21:43:53 +0200 Subject: [PATCH 3/8] testing nushell --- flake.lock | 24 ++++++++-------- flake.nix | 49 ++++++++++++++------------------- home/alisceon.nix | 32 +++++++++++++++++++++ hosts/common.nix | 44 ++++++++++++++++++++++------- hosts/electra/configuration.nix | 17 +++++++----- 5 files changed, 108 insertions(+), 58 deletions(-) diff --git a/flake.lock b/flake.lock index 38da35d..c5c495d 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1753056897, - "narHash": "sha256-AVVMBFcuOXqIgmShvRv9TED3fkiZhQ0ZvlhsPoFfkNE=", + "lastModified": 1754613544, + "narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=", "owner": "nix-community", "repo": "home-manager", - "rev": "13a83d1b6545b7f0e8f7689bad62e7a3b1d63771", + "rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f", "type": "github" }, "original": { @@ -40,11 +40,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1752950548, - "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", "type": "github" }, "original": { @@ -54,18 +54,18 @@ "type": "github" } }, - "nixpkgs-stable": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1753115646, - "narHash": "sha256-yLuz5cz5Z+sn8DRAfNkrd2Z1cV6DaYO9JMrEz4KZo/c=", + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "92c2e04a475523e723c67ef872d8037379073681", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -75,7 +75,7 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-unstable": "nixpkgs-unstable" } }, "systems": { diff --git a/flake.nix b/flake.nix index fe19fca..ab4f545 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "NixOS configuration for all hosts"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; #"github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; home-manager = { url = "github:nix-community/home-manager"; @@ -11,15 +11,32 @@ }; }; - outputs = { self, nixpkgs, flake-utils, home-manager, ... }: + outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils, home-manager, ... }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; sharedModules = [ ./hosts/common.nix + { + nixpkgs.config.allowUnfree = true; + } + home-manager.nixosModules.home-manager + ({ config, ...}: { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { + inherit (config.networking) hostName; + }; # end extraSpecialArgs + home-manager.users.alisceon = import ./home/alisceon.nix; + home-manager.backupFileExtension = "backup"; + }) # end home manager ]; in { @@ -27,39 +44,13 @@ electra = nixpkgs.lib.nixosSystem { inherit system; modules = sharedModules ++ [ - { - nixpkgs.config.allowUnfree = true; - } ./hosts/electra/configuration.nix - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit (config.networking) hostName; - }; # end extraSpecialArgs - home-manager.users.alisceon = import ./home/alisceon.nix; - home-manager.backupFileExtension = "backup"; - }) # end home manager ]; # end modules }; # end electra tower = nixpkgs.lib.nixosSystem { inherit system; modules = sharedModules ++ [ - { - nixpkgs.config.allowUnfree = true; - } ./hosts/tower/configuration.nix - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit (config.networking) hostName; - }; #end extraSpecialArgs - home-manager.users.alisceon = import ./home/alisceon.nix; - home-manager.backupFileExtension = "backup"; - }) # end home manager ]; # end modules }; # end tower }; # end nixos conf diff --git a/home/alisceon.nix b/home/alisceon.nix index 506702a..279d412 100644 --- a/home/alisceon.nix +++ b/home/alisceon.nix @@ -38,8 +38,40 @@ # Tower commands weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot"; + + # Misc commands + nix-shell = "nix shell"; }; }; # end fish + nushell = { + enable = true; + shellAliases = { + tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0"; + + # NixOS commands + nixoss = "sudo nixos-rebuild switch --flake .#${hostName}"; + nixos-main = "git checkout main && git pull && sudo nixos-rebuild switch --flake #${hostName}"; + nixossr = "sudo nixos-rebuild switch --flake .#${hostName} && reboot"; + nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}"; + + # Development commands + devt = "devenv test"; + + devtas = "devenv tasks list"; + devtar = "devenv tasks run"; + devs = "devenv shell"; + devu = "devenv up -d"; + devi = "nix flake init -t templates#"; + + pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/"; + + # Tower commands + weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot"; + + # Misc commands + nix-shell = "nix shell"; + }; + }; git = { enable = true; userName = "alisceon"; diff --git a/hosts/common.nix b/hosts/common.nix index 91e947e..4686007 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -30,7 +30,19 @@ templates.to = { type = "git"; url = "git+ssh://git@git.malice.zone/alisceon/devenv_templates.git"; - }; + }; # end templates.to + nixpkgs.to = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; # end nixpkgs.to + nixpkgs-stable.to = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-25.05"; + }; # end nixpkgs.to }; #end registry }; #end nix @@ -88,13 +100,20 @@ git wget curl - btop - ripgrep - bat - fd - eza + btop # system monitor + ripgrep # grep replacement + bat # cat replacement + fd # find replacement + eza # ls replacement + nh # nix helper + jq # JSON processor + + # Shells bash - + nushell + fish + powershell + # Chat discord signal-desktop @@ -123,6 +142,7 @@ obsidian gparted ]; # end systemPackages + gnome.excludePackages = with pkgs; [ evolution geary @@ -136,7 +156,12 @@ gnome-initial-setup gnome-clocks ]; # end gnome.excludePackages - shells = with pkgs; [ fish ]; + shells = with pkgs; [ + bash + nushell + fish + powershell + ]; }; # end environment virtualisation.podman = { @@ -148,7 +173,6 @@ users.users.alisceon = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "podman" ]; - shell = pkgs.fish; + shell = pkgs.nushell; }; # end users - } #end file diff --git a/hosts/electra/configuration.nix b/hosts/electra/configuration.nix index 4a05eb3..45f9d95 100644 --- a/hosts/electra/configuration.nix +++ b/hosts/electra/configuration.nix @@ -34,24 +34,27 @@ ]; loader.timeout = 0; #resumeDevice = "/dev/disk/by-uuid/c49249b9-0d68-44af-97e0-e399c8409408"; - }; + }; # end boot systemd.services = { fprintd = { wantedBy = [ "multi-user.target" ]; serviceConfig.Type = "simple"; }; - }; + }; # end systemd.services services = { fprintd = { enable = true; tod.enable = true; tod.driver = pkgs.libfprint-2-tod1-goodix; - }; - }; + }; # end fprintd + tuned = { + enable = true; + }; # end tuned + }; # end services hardware = { bluetooth = { enable = true; powerOnBoot = true; - }; - }; -} + }; # end bluetooth + }; # end hardware +} # end file From cd35565370995cf02ceebec5ac4de6f14c9a0c2c Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 12 Aug 2025 21:00:01 +0200 Subject: [PATCH 4/8] server v1 --- flake.nix | 9 ++ home/alisceon.nix | 12 +-- home/conf/config.nu | 24 +++++ hosts/tesla-nixos/configuration.nix | 153 ++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 7 deletions(-) create mode 100644 home/conf/config.nu create mode 100644 hosts/tesla-nixos/configuration.nix diff --git a/flake.nix b/flake.nix index ab4f545..a0a272c 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,15 @@ ./hosts/tower/configuration.nix ]; # end modules }; # end tower + tesla-nixos = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./hosts/tesla-nixos/configuration.nix + { + nixpkgs.config.allowUnfree = true; + } + ]; # end modules + }; # end tesla-nixos }; # end nixos conf }; # end "in" } # end file diff --git a/home/alisceon.nix b/home/alisceon.nix index 279d412..eff326d 100644 --- a/home/alisceon.nix +++ b/home/alisceon.nix @@ -6,7 +6,7 @@ programs = { fish = { - enable = true; + enable = false; # Disable greeting interactiveShellInit = '' set fish_greeting @@ -45,13 +45,14 @@ }; # end fish nushell = { enable = true; + configFile.source = ./conf/config.nu; shellAliases = { tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0"; # NixOS commands nixoss = "sudo nixos-rebuild switch --flake .#${hostName}"; - nixos-main = "git checkout main && git pull && sudo nixos-rebuild switch --flake #${hostName}"; - nixossr = "sudo nixos-rebuild switch --flake .#${hostName} && reboot"; + nixos-main = "git checkout main ; git pull ; sudo nixos-rebuild switch --flake #${hostName}"; + nixossr = "sudo nixos-rebuild switch --flake .#${hostName} ; reboot"; nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}"; # Development commands @@ -66,10 +67,7 @@ pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/"; # Tower commands - weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot"; - - # Misc commands - nix-shell = "nix shell"; + weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 ; reboot"; }; }; git = { diff --git a/home/conf/config.nu b/home/conf/config.nu new file mode 100644 index 0000000..ad8b9f0 --- /dev/null +++ b/home/conf/config.nu @@ -0,0 +1,24 @@ +let carapace_completer = {|spans| + carapace $spans.0 nushell ...$spans | from json +} +$env.config = { + show_banner: false, + completions: { + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $carapace_completer # check 'carapace_completer' + } + } +} +$env.PATH = ($env.PATH | +split row (char esep) | +prepend /home/myuser/.apps | +append /usr/bin/env +) diff --git a/hosts/tesla-nixos/configuration.nix b/hosts/tesla-nixos/configuration.nix new file mode 100644 index 0000000..be8b93a --- /dev/null +++ b/hosts/tesla-nixos/configuration.nix @@ -0,0 +1,153 @@ +{ config, pkgs, ... }: + +{ + imports = + [ ./hardware-configuration.nix ]; + networking.hostName = "tesla-nixos"; + boot.initrd.enable = true; + boot.loader = { + systemd-boot = { + enable = true; + }; # end loader.systemd-boot + }; # end boot + system.stateVersion = "24.05"; + system.autoUpgrade = { + enable = true; + persistent = true; + flake = "/home/alisceon/.nixos_config"; + flags = [ + "--update-input" + "nixpkgs" + "-L" + ]; + dates = "daily"; + }; # end system.autoUpgrade + + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + trusted-users = [ "root" "alisceon" ]; + }; # end settings + gc = { + automatic = true; + persistent = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; # end gc + registry = { + templates.to = { + type = "git"; + url = "git+ssh://git@git.malice.zone/alisceon/devenv_templates.git"; + }; # end templates.to + nixpkgs.to = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; # end nixpkgs.to + nixpkgs-stable.to = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-25.05"; + }; # end nixpkgs.to + }; #end registry + }; #end nix + + console.keyMap = "sv-latin1"; + networking.networkmanager.enable = true; + time.timeZone = "Europe/Stockholm"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "sv_SE.UTF-8"; + LC_IDENTIFICATION = "sv_SE.UTF-8"; + LC_MEASUREMENT = "sv_SE.UTF-8"; + LC_MONETARY = "sv_SE.UTF-8"; + LC_NAME = "sv_SE.UTF-8"; + LC_NUMERIC = "sv_SE.UTF-8"; + LC_PAPER = "sv_SE.UTF-8"; + LC_TELEPHONE = "sv_SE.UTF-8"; + LC_TIME = "sv_SE.UTF-8"; + }; + security.sudo.wheelNeedsPassword = false; + + services = { + printing.enable = true; + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + }; + xserver.xkb.layout = "se"; + displayManager = { + gdm.enable = true; + gdm.wayland = true; + }; + desktopManager.gnome.enable = true; + gnome = { + gnome-keyring.enable = true; + gnome-initial-setup.enable = false; + }; + }; # end services + + services.fwupd.enable = true; + programs = { + dconf.enable = true; + fish.enable = true; + steam = { + enable = true; + remotePlay.openFirewall = true; + }; + }; # end programs + + environment = { + systemPackages = with pkgs; [ + # CLI tools + git + wget + curl + btop # system monitor + ripgrep # grep replacement + bat # cat replacement + fd # find replacement + eza # ls replacement + nh # nix helper + jq # JSON processor + + # Shells + bash + nushell + fish + powershell + + devenv + direnv + + # Virtualization + podman + + ]; # end systemPackages + + shells = with pkgs; [ + bash + nushell + fish + powershell + ]; + }; # end environment + + virtualisation.podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; # end virtualisation + + users.users.alisceon = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "podman" ]; + shell = pkgs.nushell; + }; # end users +} # end file From 5cdc5962c62f3adc5b219dec6417911b6ea99fff Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 12 Aug 2025 21:13:42 +0200 Subject: [PATCH 5/8] server no gdm --- hosts/tesla-nixos/configuration.nix | 45 ++++++++--------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/hosts/tesla-nixos/configuration.nix b/hosts/tesla-nixos/configuration.nix index be8b93a..663e64b 100644 --- a/hosts/tesla-nixos/configuration.nix +++ b/hosts/tesla-nixos/configuration.nix @@ -11,17 +11,17 @@ }; # end loader.systemd-boot }; # end boot system.stateVersion = "24.05"; - system.autoUpgrade = { - enable = true; - persistent = true; - flake = "/home/alisceon/.nixos_config"; - flags = [ - "--update-input" - "nixpkgs" - "-L" - ]; - dates = "daily"; - }; # end system.autoUpgrade +# system.autoUpgrade = { +# enable = true; +# persistent = true; +# flake = "/home/alisceon/.nixos_config"; +# flags = [ +# "--update-input" +# "nixpkgs" +# "-L" +# ]; +# dates = "daily"; +# }; # end system.autoUpgrade nix = { settings = { @@ -73,34 +73,13 @@ security.sudo.wheelNeedsPassword = false; services = { - printing.enable = true; - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - jack.enable = true; - }; - xserver.xkb.layout = "se"; - displayManager = { - gdm.enable = true; - gdm.wayland = true; - }; - desktopManager.gnome.enable = true; - gnome = { - gnome-keyring.enable = true; - gnome-initial-setup.enable = false; - }; + openssh.enable = true; }; # end services services.fwupd.enable = true; programs = { dconf.enable = true; fish.enable = true; - steam = { - enable = true; - remotePlay.openFirewall = true; - }; }; # end programs environment = { From 781f88eb161075efffbf3923c331fffa0d953d78 Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 12 Aug 2025 21:41:55 +0200 Subject: [PATCH 6/8] we got updates --- hosts/tesla-nixos/configuration.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hosts/tesla-nixos/configuration.nix b/hosts/tesla-nixos/configuration.nix index 663e64b..b448b96 100644 --- a/hosts/tesla-nixos/configuration.nix +++ b/hosts/tesla-nixos/configuration.nix @@ -11,17 +11,17 @@ }; # end loader.systemd-boot }; # end boot system.stateVersion = "24.05"; -# system.autoUpgrade = { -# enable = true; -# persistent = true; -# flake = "/home/alisceon/.nixos_config"; -# flags = [ -# "--update-input" -# "nixpkgs" -# "-L" -# ]; -# dates = "daily"; -# }; # end system.autoUpgrade + system.autoUpgrade = { + enable = true; + persistent = true; + flake = "/home/alisceon/.nixos_config"; + flags = [ + "--update-input" + "nixpkgs" + "-L" + ]; + dates = "daily"; + }; # end system.autoUpgrade nix = { settings = { From 6b0e17913ba6ea0171871e13948fa7e95d6736bc Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 12 Aug 2025 21:43:27 +0200 Subject: [PATCH 7/8] autoupdate --- hosts/tesla-nixos/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/tesla-nixos/configuration.nix b/hosts/tesla-nixos/configuration.nix index b448b96..1392126 100644 --- a/hosts/tesla-nixos/configuration.nix +++ b/hosts/tesla-nixos/configuration.nix @@ -14,7 +14,7 @@ system.autoUpgrade = { enable = true; persistent = true; - flake = "/home/alisceon/.nixos_config"; + flake = "/home/alisceon/nixos_config"; flags = [ "--update-input" "nixpkgs" From 8cef21cca7609c36a7430c66bcd8e9363a5b4b24 Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 12 Aug 2025 22:06:16 +0200 Subject: [PATCH 8/8] nooshell fibsk --- home/alisceon.nix | 3 ++ home/conf/config.nu | 34 +++++++++++------- hosts/tesla-nixos/hardware-configuration.nix | 37 ++++++++++++++++++++ 3 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 hosts/tesla-nixos/hardware-configuration.nix diff --git a/home/alisceon.nix b/home/alisceon.nix index eff326d..833a4a0 100644 --- a/home/alisceon.nix +++ b/home/alisceon.nix @@ -120,6 +120,9 @@ hostname = "alma03.lab.the.malice.zone"; user = "root"; }; + "tsla-nixos" = { + hostname = "tesla-nixos.lab.the.malice.zone"; + }; }; }; # end ssh direnv = { diff --git a/home/conf/config.nu b/home/conf/config.nu index ad8b9f0..ddcc2fa 100644 --- a/home/conf/config.nu +++ b/home/conf/config.nu @@ -1,19 +1,29 @@ -let carapace_completer = {|spans| - carapace $spans.0 nushell ...$spans | from json +let fish_completer = {|spans| + fish --command $"complete '--do-complete=($spans | str replace --all "'" "\\'" | str join ' ')'" + | from tsv --flexible --noheaders --no-infer + | rename value description + | update value {|row| + let value = $row.value + let need_quote = ['\' ',' '[' ']' '(' ')' ' ' '\t' "'" '"' "`"] | any {$in in $value} + if ($need_quote and ($value | path exists)) { + let expanded_path = if ($value starts-with ~) {$value | path expand --no-symlink} else {$value} + $'"($expanded_path | str replace --all "\"" "\\\"")"' + } else {$value} + } } $env.config = { show_banner: false, completions: { - case_sensitive: false # case-sensitive completions - quick: true # set to false to prevent auto-selecting completions - partial: true # set to false to prevent partial filling of the prompt - algorithm: "fuzzy" # prefix or fuzzy - external: { - # set to false to prevent nushell looking into $env.PATH to find more suggestions - enable: true - # set to lower can improve completion performance at the cost of omitting some options - max_results: 100 - completer: $carapace_completer # check 'carapace_completer' + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $fish_completer } } } diff --git a/hosts/tesla-nixos/hardware-configuration.nix b/hosts/tesla-nixos/hardware-configuration.nix new file mode 100644 index 0000000..017a78a --- /dev/null +++ b/hosts/tesla-nixos/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8befd164-4151-4116-83ec-727e44e87ea8"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6841-1339"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}