From ed2d9c57f80cc88c5142e298b18bec008f3b1419 Mon Sep 17 00:00:00 2001 From: worble Date: Sat, 11 Jan 2025 21:50:29 +0000 Subject: [PATCH] add starlite --- flake.nix | 7 ++ modules/virtualisation.nix | 1 + starlite/configuration.nix | 33 ++++++++ starlite/disk-config.nix | 37 +++++++++ starlite/hardware-configuration.nix | 26 ++++++ starlite/home.nix | 119 ++++++++++++++++++++++++++++ tuxedo/configuration.nix | 2 - tuxedo/home-manager/home.nix | 3 - update.sh | 2 +- 9 files changed, 224 insertions(+), 6 deletions(-) create mode 100644 starlite/configuration.nix create mode 100644 starlite/disk-config.nix create mode 100644 starlite/hardware-configuration.nix create mode 100644 starlite/home.nix diff --git a/flake.nix b/flake.nix index 9a5adda..1039972 100644 --- a/flake.nix +++ b/flake.nix @@ -21,5 +21,12 @@ ./tuxedo/configuration.nix ]; }; + nixosConfigurations.starlite = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./configuration/base.nix + ./starlite/configuration.nix + ]; + }; }; } diff --git a/modules/virtualisation.nix b/modules/virtualisation.nix index 9d9b9c7..5d318fc 100644 --- a/modules/virtualisation.nix +++ b/modules/virtualisation.nix @@ -9,6 +9,7 @@ libvirtd = { enable = true; }; + # remember to add the necessary users to the podman group podman = { enable = true; # Create a `docker` alias for podman, to use it as a drop-in replacement diff --git a/starlite/configuration.nix b/starlite/configuration.nix new file mode 100644 index 0000000..8da5a3d --- /dev/null +++ b/starlite/configuration.nix @@ -0,0 +1,33 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, inputs, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.disko.nixosModules.default + ./disk-config.nix + inputs.home-manager.nixosModules.default + ../modules/laptop.nix + ]; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.worble = { + initialPassword = "password"; + isNormalUser = true; + extraGroups = [ "wheel" "gamemode" ]; # Enable ‘sudo’ for the user. + linger = true; + }; + + home-manager.useGlobalPkgs = true; + home-manager = { + extraSpecialArgs = { inherit inputs; }; + users = { + "worble" = import ./home.nix; + }; + }; +} diff --git a/starlite/disk-config.nix b/starlite/disk-config.nix new file mode 100644 index 0000000..88d824f --- /dev/null +++ b/starlite/disk-config.nix @@ -0,0 +1,37 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "128M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/starlite/hardware-configuration.nix b/starlite/hardware-configuration.nix new file mode 100644 index 0000000..2364384 --- /dev/null +++ b/starlite/hardware-configuration.nix @@ -0,0 +1,26 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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.enp0s20f0u1u3.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/starlite/home.nix b/starlite/home.nix new file mode 100644 index 0000000..6384ab6 --- /dev/null +++ b/starlite/home.nix @@ -0,0 +1,119 @@ +{ inputs, config, pkgs, ... }: + +{ + imports = [ + ../../home-manager/fonts.nix + ../../home-manager/terminal.nix + ../../home-manager/firefox/firefox.nix + ../../home-manager/development/vscode.nix + ]; + + terminal.nixUpdateLocation = "/home/worble/Projects/nixos#starlite"; + terminal.flakeUpdateLocation = "/home/worble/Projects/nixos"; + + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "worble"; + home.homeDirectory = "/home/worble"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.05"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs;[ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + thunderbird + keepassxc + strawberry-qt6 + rclone + qbittorrent + yt-dlp + joplin-desktop + obsidian + teamspeak_client + webcord + libreoffice-qt + jellyfin-media-player + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/worble/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + NIXOS_OZONE_WL = "1"; + }; + + # home.sessionPath = [ + # "$HOME/.local/bin" + # ]; + + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + + # Let Home Manager install and manage itself. + programs = { + home-manager.enable = true; + + chromium = { + enable = true; + package = pkgs.brave; + }; + + # install the shaders from anime4k directory for this to work + mpv = { + enable = true; + }; + }; +} diff --git a/tuxedo/configuration.nix b/tuxedo/configuration.nix index 35c005f..c6ed1e7 100644 --- a/tuxedo/configuration.nix +++ b/tuxedo/configuration.nix @@ -33,8 +33,6 @@ hardware.tuxedo-drivers.enable = true; programs.gpu-screen-recorder.enable = true; - # ......omit many configurations - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.worble = { initialPassword = "password"; diff --git a/tuxedo/home-manager/home.nix b/tuxedo/home-manager/home.nix index 8efc653..99f4082 100644 --- a/tuxedo/home-manager/home.nix +++ b/tuxedo/home-manager/home.nix @@ -200,6 +200,3 @@ text = '' }; }; } - - - diff --git a/update.sh b/update.sh index bc06463..75a8db3 100755 --- a/update.sh +++ b/update.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -sudo nixos-rebuild switch --flake '/home/worble/Projects/nixos#tuxedo' \ No newline at end of file +sudo nixos-rebuild switch --flake '/home/worble/Projects/nixos#starlite' \ No newline at end of file