Skip to content

Commit

Permalink
feat: new system
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Aug 1, 2024
1 parent 6e52a06 commit a21daa3
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 36 deletions.
163 changes: 148 additions & 15 deletions SwarselSystems.org
Original file line number Diff line number Diff line change
Expand Up @@ -613,21 +613,29 @@ This section is the biggest pain point of the configuration. For every system, I
];
};

winters = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
nbl-imba-2 = lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = nixModules ++ [
inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd
./profiles/winters/nixos.nix
inputs.home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
./profiles/winters/home.nix
];
}
./profiles/nbl-imba-2
];
};

nginx = nixpkgs.lib.nixosSystem {
# winters = nixpkgs.lib.nixosSystem {
# specialArgs = { inherit inputs; };
# modules = nixModules ++ [
# inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd
# ./profiles/winters/nixos.nix
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager.users.swarsel.imports = mixedModules ++ [
# ./profiles/winters/home.nix
# ];
# }
# ];
# };

nginx = nixpkgs.lib.nixos
System {
specialArgs = { inherit inputs; };
modules = [
inputs.sops-nix.nixosModules.sops
Expand Down Expand Up @@ -2130,6 +2138,119 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was
}


#+end_src

**** nbl-imba-2 (Framework Laptop 16)
:PROPERTIES:
:CUSTOM_ID: h:6c6e9261-dfa1-42d8-ab2a-8b7c227be6d9
:END:

My work machine.


#+begin_src nix :tangle profiles/nbl-imba-2/default.nix

{ inputs, outputs, config, pkgs, ... }:
{

imports = [
inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd

./hardware-configuration.nix

../optional/nixos/steam.nix
../optional/nixos/virtualbox.nix
../optional/nixos/autologin.nix
../optional/nixos/nswitch-rcm.nix

inputs.home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = outputs.mixedModules ++ [
../optional/home/gaming.nix
] ++ (builtins.attrValues outputs.homeManagerModules);
}
] ++ (builtins.attrValues outputs.nixosModules);


nixpkgs = {
inherit (outputs) overlays;
config = {
allowUnfree = true;
};
};

# boot = {
# loader.systemd-boot.enable = true;
# loader.efi.canTouchEfiVariables = true;
# kernelPackages = pkgs.linuxPackages_latest;
# };


networking = {
hostName = "nbl-imba-2";
fqdn = "nbl-imba-2.imp.univie.ac.at";
firewall.enable = true;
};

hardware.graphics.extraPackages = with pkgs; [
vulkan-loader
vulkan-validation-layers
vulkan-extension-layer
];

services = {
fwupd.enable = true;
};

swarselsystems = {
wallpaper = ../../wallpaper/lenovowp.png;
hasBluetooth = true;
hasFingerprint = true;
initialSetup = true;
};

home-manager.users.swarsel.swarselsystems = {
isLaptop = true;
isNixos = true;
# temperatureHwmon = {
# isAbsolutePath = true;
# path = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
# input-filename = "temp1_input";
# };
# ------ -----
# | DP-4 | |eDP-1|
# ------ -----
# monitors = {
# main = {
# name = "California Institute of Technology 0x1407 Unknown";
# mode = "1920x1080"; # TEMPLATE
# scale = "1";
# position = "2560,0";
# workspace = "2:二";
# output = "eDP-1";
# };
# homedesktop = {
# name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
# mode = "2560x1440";
# scale = "1";
# position = "0,0";
# workspace = "1:一";
# output = "DP-4";
# };
# };
# inputs = {
# "1:1:AT_Translated_Set_2_keyboard" = {
# xkb_layout = "us";
# xkb_options = "grp:win_space_toggle";
# xkb_variant = "altgr-intl";
# };
# };
keybindings = {
};
};
}


#+end_src

**** Winters (Framwork Laptop 16)
Expand Down Expand Up @@ -4657,6 +4778,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
{
wallpaper = import ./wallpaper.nix;
hardware = import ./hardware.nix;
setup = import ./setup.nix;
}
#+end_src

Expand Down Expand Up @@ -4691,6 +4813,16 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
}
#+end_src

***** Hardware

#+begin_src nix :tangle modules/nixos/setup.nix
{ lib, ... }:

{
options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)";
}
#+end_src


**** home-manager

Expand Down Expand Up @@ -4830,7 +4962,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
options.swarselsystems.kyria = mkOption {
type = types.attrsOf (types.attrsOf types.str );
default = {
"36125:53060:splitkb.com_Kyria_rev3" = {
"36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
Expand Down Expand Up @@ -5016,14 +5148,14 @@ Next, we setup the keymap in case we are not in a graphical session. At this poi
This ensures that all user-configuration happens here in the config file.

#+begin_src nix :tangle profiles/common/nixos/users.nix
{ pkgs, config, ... }:
{ pkgs, config, lib, ... }:
{
users = {
mutableUsers = false;
mutableUsers = lib.mkIf (!config.swarselsystems.initialSetup) false;
users.swarsel = {
isNormalUser = true;
description = "Leon S";
hashedPasswordFile = config.sops.secrets.swarseluser.path;
hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path;
extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ];
packages = with pkgs; [ ];
};
Expand Down Expand Up @@ -6064,6 +6196,7 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
picard-tools
audacity
sox
google-chrome

# printing
cups
Expand Down
43 changes: 26 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,27 +212,36 @@
];
};

winters = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
nbl-imba-2 = lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = nixModules ++ [
inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd
./profiles/winters/nixos.nix
inputs.home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
./profiles/winters/home.nix
];
}
./profiles/nbl-imba-2
];
};

nginx = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
inputs.sops-nix.nixosModules.sops
./profiles/server1/nginx/nixos.nix
];
};
# winters = nixpkgs.lib.nixosSystem {
# specialArgs = { inherit inputs; };
# modules = nixModules ++ [
# inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd
# ./profiles/winters/nixos.nix
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager.users.swarsel.imports = mixedModules ++ [
# ./profiles/winters/home.nix
# ];
# }
# ];
# };

nginx = nixpkgs.lib.nixos
System
{
specialArgs = { inherit inputs; };
modules = [
inputs.sops-nix.nixosModules.sops
./profiles/server1/nginx/nixos.nix
];
};

calibre = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
Expand Down
2 changes: 1 addition & 1 deletion modules/home/input.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in
options.swarselsystems.kyria = mkOption {
type = types.attrsOf (types.attrsOf types.str);
default = {
"36125:53060:splitkb.com_Kyria_rev3" = {
"36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
wallpaper = import ./wallpaper.nix;
hardware = import ./hardware.nix;
setup = import ./setup.nix;
}
5 changes: 5 additions & 0 deletions modules/nixos/setup.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ lib, ... }:

{
options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)";
}
1 change: 1 addition & 0 deletions profiles/common/home/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
picard-tools
audacity
sox
google-chrome

# printing
cups
Expand Down
6 changes: 3 additions & 3 deletions profiles/common/nixos/users.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ pkgs, config, ... }:
{ pkgs, config, lib, ... }:
{
users = {
mutableUsers = false;
mutableUsers = lib.mkIf (!config.swarselsystems.initialSetup) false;
users.swarsel = {
isNormalUser = true;
description = "Leon S";
hashedPasswordFile = config.sops.secrets.swarseluser.path;
hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path;
extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ];
packages = with pkgs; [ ];
};
Expand Down
Loading

0 comments on commit a21daa3

Please sign in to comment.