Skip to content

Commit

Permalink
Add steambox role
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Sep 22, 2023
1 parent ad36885 commit 6fc90dc
Show file tree
Hide file tree
Showing 21 changed files with 242 additions and 99 deletions.
2 changes: 0 additions & 2 deletions home/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
];

enableNixpkgsReleaseCheck = true;

stateVersion = "22.11";
};

xdg.userDirs = {
Expand Down
8 changes: 6 additions & 2 deletions hosts/nixos-vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@

custom = {
base.users = [ "demo" "christian" ];
roles.desktop.enable = true;
roles = {
desktop.enable = true;
gaming.enable = true;
printing.enable = true;
};
};

# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

system.stateVersion = "22.11";
system.stateVersion = import ./state-version.nix;
}
2 changes: 2 additions & 0 deletions hosts/nixos-vm/home-christian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
custom = {
users.christian.enable = true;
};

home.stateVersion = import ./state-version.nix;
}
2 changes: 2 additions & 0 deletions hosts/nixos-vm/home-demo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
users.demo.enable = true;
roles.desktop.enable = true;
};

home.stateVersion = import ./state-version.nix;
}
1 change: 1 addition & 0 deletions hosts/nixos-vm/state-version.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"23.05"
2 changes: 2 additions & 0 deletions hosts/non-nixos-vm/home-christian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
base.non-nixos.enable = true;
users.christian.enable = true;
};

home.stateVersion = import ./state-version.nix;
}
2 changes: 2 additions & 0 deletions hosts/non-nixos-vm/home-demo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
web.enable = true;
};
};

home.stateVersion = import ./state-version.nix;
}
1 change: 1 addition & 0 deletions hosts/non-nixos-vm/state-version.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"23.05"
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ in
services = {
xserver = {
layout = "ch";

# Touchpad settings
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
disableWhileTyping = true;
sendEventsMode = "disabled-on-external-mouse";
};
};
};

udev.extraRules = ''
Expand Down
5 changes: 4 additions & 1 deletion nixos/base/system/network/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
programs.nm-applet.enable = true;

# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
}
25 changes: 25 additions & 0 deletions nixos/programs/direnv/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ config, lib, pkgs, ... } @ args:

with lib;

let

cfg = config.custom.programs.direnv;

in

{
options = {
custom.programs.direnv = {
enable = mkEnableOption "Direnv config";
};
};

config = mkIf cfg.enable {
# Nix options for derivations to persist garbage collection
nix.extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
};
}
10 changes: 9 additions & 1 deletion nixos/roles/desktop/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... } @ args:
{ config, lib, pkgs, ... }:

with lib;

Expand All @@ -16,6 +16,14 @@ in
};

config = mkIf cfg.enable {
custom = {
programs.direnv.enable = true;
roles = {
printing.enable = true;
sound.enable = true;
};
};

services = {
xserver = {
enable = true;
Expand Down
7 changes: 0 additions & 7 deletions nixos/roles/desktop/direnv/default.nix

This file was deleted.

22 changes: 0 additions & 22 deletions nixos/roles/desktop/gaming/default.nix

This file was deleted.

39 changes: 0 additions & 39 deletions nixos/roles/desktop/printing/default.nix

This file was deleted.

13 changes: 0 additions & 13 deletions nixos/roles/desktop/sound/default.nix

This file was deleted.

34 changes: 34 additions & 0 deletions nixos/roles/gaming/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:

with lib;

let

cfg = config.custom.roles.gaming;

in

{
options = {
custom.roles.gaming = {
enable = mkEnableOption "Gaming computer config";
};
};

config = mkIf cfg.enable {
# open ports for steam stream and some games
networking.firewall.allowedTCPPorts = [ 27036 27037 ] ++ (range 27015 27030);
networking.firewall.allowedUDPPorts = [ 4380 27036 ] ++ (range 27000 27031);

programs.steam.enable = true;

# Gaming 32bit
#hardware.opengl.driSupport32Bit = true;
#hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
#hardware.pulseaudio.support32Bit = true;

# Xbox controller
hardware.xpadneo.enable = true;
#boot.extraModprobeConfig = '' options bluetooth disable_ertm=1 '';
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,42 @@ with lib;

let

cfg = config.custom.roles.desktop.mobile;
cfg = config.custom.roles.mobile;

in

{
options = {
custom.roles.desktop.mobile = {
custom.roles.mobile = {
enable = mkEnableOption "Mobile computer config";
};
};

config = mkIf cfg.enable {
custom.programs = {
direnv.enable = true;
};

services = {
logind = {
lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "lock";
};

upower.enable = true;

xserver = {
# Touchpad settings
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
disableWhileTyping = true;
sendEventsMode = "disabled-on-external-mouse";
};
};
};
};

networking.networkmanager.dispatcherScripts = [{
Expand Down
48 changes: 48 additions & 0 deletions nixos/roles/printing/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ config, lib, pkgs, ... }:

with lib;

let

cfg = config.custom.roles.printing;

in

{
options = {
custom.roles.printing = {
enable = mkEnableOption "Printing config";
};
};

config = mkIf cfg.enable {
services.printing = {
enable = true;
drivers = [ pkgs.hplip ];
};

hardware = {
printers.ensurePrinters = [{
name = "pr-hp-chr";
location = "Home Office";
description = "HP Officejet Pro 8600 Plus";
deviceUri = "hp:/net/Officejet_Pro_8600?hostname=pr-hp-chr";
model = "drv:///hp/hpcups.drv/hp-officejet_pro_8600.ppd";
ppdOptions = {
"PageSize" = "A4";
"Duplex" = "DuplexNoTumble";
"InputSlot" = "Tray2";
"ColorModel" = "KGray";
"MediaType" = "Plain";
"OutputMode" = "Normal";
"OptionDuplex" = "True";
};
}];

sane = {
enable = true;
extraBackends = [ pkgs.hplip ];
};
};
};
}
29 changes: 29 additions & 0 deletions nixos/roles/sound/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:

with lib;

let

cfg = config.custom.roles.sound;

in

{
options = {
custom.roles.sound = {
enable = mkEnableOption "Audio config";
};
};

config = mkIf cfg.enable {
sound.enable = true;
hardware = {
bluetooth.enable = true;
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
};
};
environment.systemPackages = [ pkgs.pavucontrol ];
};
}
Loading

0 comments on commit 6fc90dc

Please sign in to comment.