From 5e573e45ba85e6ce7f201652780be6fdf9c05f66 Mon Sep 17 00:00:00 2001 From: blaknull Date: Thu, 9 Jan 2025 10:48:22 -0600 Subject: [PATCH] install for laptop 1st attempt --- README.md | 3 +- flake.nix | 13 +-- .../configuration/homebox/default.nix | 6 ++ .../configuration/laptop/default.nix | 63 ++++++++------ system-config/configuration/live/default.nix | 83 ++++++++++++++++++- system-config/configuration/live/disko.nix | 36 ++------ system-config/configuration/live/wip.nix | 75 +++++++++++++++++ system-config/services/sddm/flake.nix | 7 -- 8 files changed, 216 insertions(+), 70 deletions(-) create mode 100644 system-config/configuration/live/wip.nix diff --git a/README.md b/README.md index 70eb7ef..99a9298 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -# NixOS System Config +# Project 001 - Olympus This is a repo for all of my nixos system configurations and isos # Goal: >- to define configs for all my nixos machines >- to create a **100% reproduceable** system that can be deployed **offline** and **unattended** +>- to serve as a foundation for future projects diff --git a/flake.nix b/flake.nix index 8ba9299..3275aad 100644 --- a/flake.nix +++ b/flake.nix @@ -45,18 +45,21 @@ nixosConfigurations.homebox = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ - ./system-config/configuration/homebox - ]; }; - nixosConfigurations.laptop = nixpkgs.lib.nixosSystem { + nixosConfigurations.laptop = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ - ./system-config/configuration/laptop - + ]; + }; + + nixosConfigurations.live = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./system-config/configuration/live ]; }; }; diff --git a/system-config/configuration/homebox/default.nix b/system-config/configuration/homebox/default.nix index dec9b1a..be68259 100644 --- a/system-config/configuration/homebox/default.nix +++ b/system-config/configuration/homebox/default.nix @@ -86,6 +86,12 @@ LC_TIME = "en_US.UTF-8"; }; + services.displayManager.sddm.settings.AutoLogin = { + User = "nathan"; + Session = "hyprland"; + Relogin = true; + }; + networking = { hostName = "homebox"; nameservers = [ "1.1.1.1" "1.0.0.1" ]; diff --git a/system-config/configuration/laptop/default.nix b/system-config/configuration/laptop/default.nix index 5fbe96e..f2f2d8d 100644 --- a/system-config/configuration/laptop/default.nix +++ b/system-config/configuration/laptop/default.nix @@ -1,10 +1,18 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: +{ config, pkgs, lib, inputs, ... }: { + + imports = [ + ./hardware-configuration.nix + + inputs.system.nixosModule + + inputs.home-manager.nixosModules.default + + inputs.sops-nix.nixosModules.sops + ]; + + nixpkgs.config.allowUnfree = true; # Bootloader. @@ -17,12 +25,7 @@ }; hardware = { -#graphics.enable = true; - - opengl = { - enable = true; - driSupport = true; - }; + graphics.enable = true; nvidia = { modesetting.enable = true; @@ -52,6 +55,7 @@ }; sysconfig.opts = { + sddm.enable = true; openssh.enable = false; steam.enable = true; pipewire.enable = true; @@ -61,6 +65,30 @@ nh.enable = true; }; + home-manager = { + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs; }; + users = { + "nathan" = lib.mkMerge [ + { + config.homeconfig = { + impermanence.enable = false; + hyprland.enable = true; + swaylock.enable = true; + wal.enable = true; + wayvnc.enable = false; + mpd.enable = true; + ags.enable = true; + calcurse.enable = true; + rofi.enable = true; + firefox.enable = true; + }; + } + inputs.nathan.homeManagerModule + ]; + }; + }; + # Enable the X11 windowing system. services.xserver = { enable = true; @@ -80,30 +108,17 @@ }; -# Configure network proxy if necessary -# networking.proxy.default = "http://user:password@proxy:port/"; -# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - environment.shells = with pkgs; [ zsh ]; # Enable CUPS to print documents. services.printing.enable = true; -# Enable touchpad support (enabled default in most desktopManager). -# services.xserver.libinput.enable = true; - programs.adb.enable = true; users.defaultUserShell = pkgs.zsh; programs.zsh.enable = true; -# This value determines the NixOS release from which the default -# settings for stateful data, like file locations and database versions -# on your system were taken. It‘s perfectly fine and recommended to leave -# this value at the release version of the first install of this system. -# Before changing this value read the documentation for this option -# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? } diff --git a/system-config/configuration/live/default.nix b/system-config/configuration/live/default.nix index 9bc0370..2d1f853 100644 --- a/system-config/configuration/live/default.nix +++ b/system-config/configuration/live/default.nix @@ -1,5 +1,84 @@ -{ config, lib, pkgs, inputs, ... }: { +{ config, lib, pkgs, inputs, modulesPath, ... }: { + + imports = with inputs; [ + + disko.nixosModules.default + + (import ./disko.nix { device = "/dev/sda"; }) + + (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") + + #sops-nix.nixosModules.sops + + #home-manager.nixosModules.default + + #system.nixosModule + ]; + + config = { + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot = { + #kernelPackages = pkgs.linuxKernel.packages.linux_6_6; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; - system.stateVersion = "24.05"; + /*sysconfig.opts = { + sddm.enable = true; + openssh.enable = false; + pipewire.enable = true; + ags.enable = true; + hyprland.enable = true; + git.enable = true; + nh.enable = true; + };*/ + + users.users."nathan" = { + isNormalUser = true; + initialPassword = "7567"; + extraGroups = [ "wheel" ]; + }; + + /*home-manager = { + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs; }; + users = { + "nathan" = lib.mkMerge [ + inputs.nathan.homeManagerModule + { + config.homeconfig = { + impermanence.enable = false; + hyprland.enable = true; + swaylock.enable = true; + wal.enable = true; + wayvnc.enable = false; + mpd.enable = true; + ags.enable = true; + calcurse.enable = true; + rofi.enable = true; + firefox.enable = true; + }; + } + ]; + }; + };*/ + + system.stateVersion = "24.11"; + + nix = { + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + settings = { + experimental-features = [ "nix-command" "flakes" ]; + }; + }; + + networking.hostName = "live"; + + fonts.packages = with pkgs; [ fira-code-nerdfont ]; + }; } diff --git a/system-config/configuration/live/disko.nix b/system-config/configuration/live/disko.nix index 2f588c4..9ad4f58 100644 --- a/system-config/configuration/live/disko.nix +++ b/system-config/configuration/live/disko.nix @@ -14,6 +14,7 @@ name = "boot"; size = "1M"; type = "EF02"; + priority = 1; }; esp = { name = "ESP"; @@ -23,49 +24,22 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; + mountOptions = [ "unmask=0077" ]; }; }; root = { name = "root"; size = "100%"; content = { - type = "lvm_pv"; - vg = "root_vg"; + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; }; }; }; }; }; - lvm_vg = { - root_vg = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%FREE"; - content = { - type = "btrfs"; - extraArgs = ["-f"]; - subvolumes = { - "/root" = { - mountpoint = "/"; - }; - - "/persist" = { - mountOptions = ["subvol=persist" "noatime"]; - mountpoint = "/persist"; - }; - - "/nix" = { - mountOptions = ["subvol=nix" "noatime"]; - mountpoint = "/nix"; - }; - }; - }; - }; - }; - }; - }; }; } diff --git a/system-config/configuration/live/wip.nix b/system-config/configuration/live/wip.nix new file mode 100644 index 0000000..73a0068 --- /dev/null +++ b/system-config/configuration/live/wip.nix @@ -0,0 +1,75 @@ +{ config, lib, pkgs, inputs, modulesPath, ... }: { + + imports = with inputs; [ + + disko.nixosModules.default + + (import ./disko.nix { device = "/dev/sda"; }) + + (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") + + sops-nix.nixosModules.sops + + home-manager.nixosModules.default + + system.nixosModule + ]; + + config = { + + nixpkgs.hostPlatform = "x86_64-linux"; + + sysconfig.opts = { + sddm.enable = true; + openssh.enable = false; + pipewire.enable = true; + ags.enable = true; + hyprland.enable = true; + git.enable = true; + nh.enable = true; + }; + + users.users."nathan" = { + isNormalUser = true; + initialPassword = "7567"; + extraGroups = [ "wheel" ]; + }; + + home-manager = { + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs; }; + users = { + "nathan" = lib.mkMerge [ + inputs.nathan.homeManagerModule + { + config.homeconfig = { + impermanence.enable = false; + hyprland.enable = true; + swaylock.enable = true; + wal.enable = true; + wayvnc.enable = false; + mpd.enable = true; + ags.enable = true; + calcurse.enable = true; + rofi.enable = true; + firefox.enable = true; + }; + } + ]; + }; + }; + + system.stateVersion = "24.11"; + + nix = { + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + settings = { + experimental-features = [ "nix-command" "flakes" ]; + }; + }; + + networking.hostName = "live"; + + fonts.packages = with pkgs; [ fira-code-nerdfont ]; + }; +} diff --git a/system-config/services/sddm/flake.nix b/system-config/services/sddm/flake.nix index 13caf5c..779bd21 100644 --- a/system-config/services/sddm/flake.nix +++ b/system-config/services/sddm/flake.nix @@ -31,13 +31,6 @@ libsForQt5.qtquickcontrols2 libsForQt5.qtgraphicaleffects ]; - settings = { - Autologin = { - User = "nathan"; - Session = "hyprland"; - Relogin = true; - }; - }; }; }; };