diff --git a/flake.nix b/flake.nix index adaf647..a95bc4c 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,11 @@ }; erosanix.url = "github:emmanuelrosa/erosanix"; + + jovian = { + url = "github:Jovian-Experiments/Jovian-NixOS"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; }; outputs = inputs @ { self, nixpkgs, nix-minecraft, flux, ... }: diff --git a/hosts/tulkas/default.nix b/hosts/tulkas/default.nix new file mode 100644 index 0000000..c93e25f --- /dev/null +++ b/hosts/tulkas/default.nix @@ -0,0 +1,19 @@ +{ config, ... }: +{ + modules = { + system.audio.enable = true; + + gaming.enable = true; + + root = { + user = { + full_name = "__ROOT__"; + email = "__ROOT__@${config.networking.hostName}"; + }; + + shell = { + default = "zsh"; + }; + }; + }; +} diff --git a/hosts/tulkas/hardware.nix b/hosts/tulkas/hardware.nix new file mode 100644 index 0000000..856f139 --- /dev/null +++ b/hosts/tulkas/hardware.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, modulesPath, ... }: +let + inherit (lib.modules) mkDefault; +in +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8c4eaf57-fdb2-4c4c-bcc0-74e85a1c7985"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C842-316A"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/0ddf001a-5679-482e-b254-04a1b9094794"; } + ]; + + boot = { + initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + kernelParams = []; + extraModulePackages = [ ]; + }; + + nixpkgs.hostPlatform = mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/tulkas/users/chris/default.nix b/hosts/tulkas/users/chris/default.nix new file mode 100644 index 0000000..2d0cfed --- /dev/null +++ b/hosts/tulkas/users/chris/default.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + user = { + full_name = "Chris Kruining"; + email = "chris@kruining.eu"; + is_trusted = true; + }; + + themes = { + enable = true; + theme = "everforest"; + polarity = "dark"; + }; + + desktop = { + plasma = { + enable = true; + autoLogin = true; + }; + + applications = { + steam.enable = true; + }; + + terminal = { + default = "ghostty"; + ghostty.enable = true; + }; + + editors = { + default = "nano"; + nano.enable = true; + }; + }; + + shell = { + default = "zsh"; + }; +} diff --git a/lib/nixos.nix b/lib/nixos.nix index e3e94fb..610657f 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -42,10 +42,10 @@ in rec }) (filterAttrs (n: v: !elem n ["system"]) attrs) (import path) - (args@{ inputs, lib, pkgs, config, options, ... }: { + (args@{ ... }: { imports = mapModulesRec' ../modules/home (file: (import file (args // { user = "root"; }))); }) - ({config, ...}: { + ({...}: { imports = []; config = { @@ -61,7 +61,7 @@ in rec }; }) ] - ++ (map (user: (args@{ inputs, lib, pkgs, config, options, ... }: { + ++ (map (user: (args@{ ... }: { imports = mapModulesRec' ../modules/home (file: (import file (args // { inherit user; }))); config.modules.${user} = (import "${path}/users/${user}/default.nix" args); diff --git a/modules/home/desktop/terminal/alacritty.nix b/modules/home/desktop/terminal/alacritty.nix index 858b1cc..76e528d 100644 --- a/modules/home/desktop/terminal/alacritty.nix +++ b/modules/home/desktop/terminal/alacritty.nix @@ -1,12 +1,10 @@ { config, - options, lib, pkgs, user, ... }: let - inherit (builtins) toString; inherit (lib.meta) getExe; inherit (lib.modules) mkIf mkMerge; in { diff --git a/modules/home/shell/zsh.nix b/modules/home/shell/zsh.nix index d6e3f4d..e6fc881 100644 --- a/modules/home/shell/zsh.nix +++ b/modules/home/shell/zsh.nix @@ -1,8 +1,6 @@ { config, lib, pkgs, user, ... }: let - inherit (lib.attrsets) mapAttrsToList; inherit (lib.modules) mkIf; - inherit (lib.strings) concatStrings escapeNixString; cfg = config.modules.${user}.shell; in diff --git a/modules/home/themes/default.nix b/modules/home/themes/default.nix index 2bebfc4..50d8ac7 100644 --- a/modules/home/themes/default.nix +++ b/modules/home/themes/default.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, user, ... }: let - inherit (lib) mkIf mkDefault; + inherit (lib) mkIf; inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) nullOr enum; diff --git a/modules/system/desktop/gaming.nix b/modules/system/desktop/gaming.nix new file mode 100644 index 0000000..ea37d1f --- /dev/null +++ b/modules/system/desktop/gaming.nix @@ -0,0 +1,20 @@ +{ inputs, lib, config, ... }: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.desktop.gaming; +in +{ + imports = [ inputs.jovian.nixosModules.default ]; + + options.modules.desktop.gaming = { + enable = mkEnableOption "enable steamdeck like desktop"; + }; + + config = mkIf cfg.enable { + jovian.steam = { + enable = true; + autoStart = true; + + }; + }; +} diff --git a/modules/system/graphics.nix b/modules/system/graphics.nix index 55f020e..a4d9775 100644 --- a/modules/system/graphics.nix +++ b/modules/system/graphics.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/modules/system/options.nix b/modules/system/options.nix index 0558323..abce819 100644 --- a/modules/system/options.nix +++ b/modules/system/options.nix @@ -1,15 +1,10 @@ -{ inputs, config, options, lib, pkgs, ... }: +{ config, lib, ... }: let - inherit (builtins) pathExists toString; - inherit (lib.lists) findFirst; - inherit (lib.modules) mkAliasDefinitions; + inherit (lib.types) attrs; + inherit (lib.my) mkOpt; in { - options = let - inherit (lib.types) attrs path; - inherit (lib.my) mkOpt; - in - { + options = { user = mkOpt attrs {}; }; diff --git a/modules/system/system/audio.nix b/modules/system/system/audio.nix index e29afa9..e26c06b 100644 --- a/modules/system/system/audio.nix +++ b/modules/system/system/audio.nix @@ -1,4 +1,4 @@ -{ config, options, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let inherit (lib.attrsets) attrValues; inherit (lib.modules) mkIf; diff --git a/modules/system/system/bluetooth.nix b/modules/system/system/bluetooth.nix index 480f129..45343c3 100644 --- a/modules/system/system/bluetooth.nix +++ b/modules/system/system/bluetooth.nix @@ -1,15 +1,12 @@ -{ config, options, lib, pkgs, ... }: +{ config, lib, ... }: let - inherit (lib.attrsets) attrValues; inherit (lib.modules) mkIf; + inherit (lib.options) mkEnableOption; cfg = config.modules.system.bluetooth; in { - options.modules.system.bluetooth = let - inherit (lib.options) mkEnableOption; - in - { + options.modules.system.bluetooth = { enable = mkEnableOption "enable bluetooth"; };