From e797d5a468fa8f1777328ec29c52b5f95700fce3 Mon Sep 17 00:00:00 2001 From: Eric Tossell Date: Thu, 16 Nov 2023 11:19:31 -0500 Subject: [PATCH] Live image configurations --- .gitignore | 8 ++---- flake.nix | 51 ++++++++++++++++++++++++++++++++--- minimal.nix | 10 +++++++ modules/core/pkgs/default.nix | 9 +++++++ sh/build.sh | 27 ++++++++++--------- users/nixos/default.nix | 10 +++++++ 6 files changed, 93 insertions(+), 22 deletions(-) create mode 100644 minimal.nix create mode 100644 modules/core/pkgs/default.nix create mode 100644 users/nixos/default.nix diff --git a/.gitignore b/.gitignore index c385384f..a9313783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ -.gitconfig -.gitconfig* -smb-secrets* -smb-secrets -samba/* -samba +result/* +result diff --git a/flake.nix b/flake.nix index 6f7cdf02..2010b1b9 100644 --- a/flake.nix +++ b/flake.nix @@ -15,10 +15,10 @@ }; - outputs = { self, nixpkgs, ... } @ attrs: { nixosConfigurations = { + retis = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { @@ -47,20 +47,65 @@ ./. ]; };#sisyphus +# Appended new system + test1 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + username = "test1"; + hostname = "test1"; + displayConfig = "laptop"; + nvidia_bool = "enabled"; + } // attrs; + modules = [ + ./. + ]; + };#test1 +# Appended new system + test = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + username = "test"; + hostname = "test"; + displayConfig = "laptop"; + nvidia_bool = "enabled"; + } // attrs; + modules = [ + ./. + ]; + };#test + # A minimal dev-vm config for building custom ISO's live = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { - username = "eriim"; + username = "nixos"; hostname = "live"; displayConfig = "laptop"; nvidia_bool = "disabled"; } // attrs; modules = [ - ./. + ./minimal.nix + ]; + };#live-image + + + live-hyprland = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + username = "nixos"; + hostname = "live"; + displayConfig = "laptop"; + nvidia_bool = "disabled"; + } // attrs; + modules = [ + ./minimal.nix + ./modules/hyprland + ./assets ]; };#live-image + + }; }; } diff --git a/minimal.nix b/minimal.nix new file mode 100644 index 00000000..906a9da6 --- /dev/null +++ b/minimal.nix @@ -0,0 +1,10 @@ +{ home-manager, ... }: +{ + imports = [ + home-manager.nixosModules.home-manager + ./users + ./hosts + ./modules/core/terminal + ./modules/core/pkgs + ]; +} diff --git a/modules/core/pkgs/default.nix b/modules/core/pkgs/default.nix new file mode 100644 index 00000000..7ac2b6fd --- /dev/null +++ b/modules/core/pkgs/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +let + corePackages = import ./core { inherit pkgs; }; + devPackages = import ./dev { inherit pkgs; }; +in +{ + environment.systemPackages = corePackages ++ devPackages; + +} diff --git a/sh/build.sh b/sh/build.sh index f126c85d..e03c2036 100755 --- a/sh/build.sh +++ b/sh/build.sh @@ -86,19 +86,20 @@ echo "Creating a basic system configuration in flake.nix..." # Define the new configuration block # Define the new configuration block read -r -d '' NEW_CONFIG << EOM - # Appended new system - nixosConfigurations.$hostname = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - username = "$username"; - hostname = "$hostname"; - displayConfig = "laptop"; - nvidia_bool = "$nvidia"; - } // attrs; - modules = [ - ./. - ]; - };#$hostname + + # Appended new system + # $hostname = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + username = "$username"; + hostname = "$hostname"; + displayConfig = "laptop"; + nvidia_bool = "$nvidia"; + } // attrs; + modules = [ + ./. + ]; + };#$hostname EOM # Use awk to append the new configuration block before the last closing brace of the outputs block diff --git a/users/nixos/default.nix b/users/nixos/default.nix new file mode 100644 index 00000000..182a080c --- /dev/null +++ b/users/nixos/default.nix @@ -0,0 +1,10 @@ +{ pkgs, username, ... }: +{ +# Define a user account. Don't forget to set a password with ‘passwd’. + users.users.${username} = { + shell = pkgs.bash; + isNormalUser = true; + initialPassword = "temp123"; + extraGroups = [ "wheel" ]; + }; +}