From 96057e337bbab839098fa865a68d7b78cf9e22c6 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 8 Aug 2025 21:43:53 +0200 Subject: [PATCH] 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