Skip to content

Commit

Permalink
Chuwi nix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKnarf committed Nov 13, 2024
1 parent 40d9ef2 commit 4d27a42
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 35 deletions.
12 changes: 6 additions & 6 deletions os/nixos/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 26 additions & 9 deletions os/nixos/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

inputs = {
nixpkgs = {
#url = "github:nixos/nixpkgs/nixos-unstable";
url = "github:jopejoe1/nixpkgs/alvr-src";
url = "github:nixos/nixpkgs/nixos-unstable";
#url = "github:jopejoe1/nixpkgs/alvr-src";
};

home-manager = {
Expand Down Expand Up @@ -41,19 +41,36 @@
};
user = "knarf";
in {
# Machine
# Machines
nixosConfigurations."nixos" = nixpkgs.lib.nixosSystem {
inherit pkgs;
inherit system;

modules = [
./host/nixos.config.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./home-manager/home.nix;
}
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./home-manager/home.nix;
}
];

specialArgs = {inherit user;};
};

nixosConfigurations."chuwi" = nixpkgs.lib.nixosSystem {
inherit pkgs;
inherit system;

modules = [
./host/chuwi.config.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./home-manager/home.nix;
}
];

specialArgs = {inherit user;};
Expand Down
108 changes: 108 additions & 0 deletions os/nixos/host/chuwi.config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{ config, pkgs, ... }:

{
imports = [
# hardware config
./chuwi.hardware.nix

# Modules
./mods/tailscale.nix
];

# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];

# Bootloader
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};

# Enable networking
networking = {
hostName = "chuwi";
networkmanager.enable = true;
};

# Time zone & locale
time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8";

# Enable the X11 windowing system.
services.xserver.enable = true;

# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;

# Configure keymap in X11
services.xserver.xkb = {
layout = "no";
variant = "";
};

# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;

# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};

# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.knarf = {
isNormalUser = true;
description = "knarf";
extraGroups = [
"networkmanager"
"wheel"
"docker"
"audio"
"seat" # seatd group
"incus-admin"
"incus"
];
packages = with pkgs; [];
shell = pkgs.zsh;
};

# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
wget
git
tmux
bash
home-manager
zsh
pciutils
gnumake
];

programs.zsh.enable = true;
programs.firefox.enable = true;

# Enable the OpenSSH daemon.
services.openssh.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 = "24.05"; # Did you read the comment?

}
38 changes: 38 additions & 0 deletions os/nixos/host/chuwi.hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/dc4a9bdf-fd39-4f82-b331-8c32aaa544b5";
fsType = "ext4";
};

fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/32C9-4CD0";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};

swapDevices = [ ];

# 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.<interface>.useDHCP`.
networking.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;
}
13 changes: 4 additions & 9 deletions os/nixos/host/mods/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

{
environment.systemPackages = with pkgs; [
mangohud # overlay showing cpu / gpu load, etc
mangohud # overlay showing cpu / gpu load, etc
gamescope
protonup
lutris
protonup
lutris
];

programs.gamemode.enable = true;
programs.gamemode.enable = true;
programs.gamescope.enable = true;

hardware.steam-hardware.enable = true;
Expand All @@ -28,9 +28,4 @@
enable = true;
openFirewall = true;
};

#pkgs.alvr.override {

#};

}
23 changes: 12 additions & 11 deletions os/nixos/host/nixos.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
{
imports = [
# Hardware configuration
./nixos.hardware.nix
./nixos.hardware.nix

# Modules
./mods/steam.nix
./mods/audio-video.nix
./mods/steam.nix
./mods/audio-video.nix
./mods/virtual.nix
./mods/gnome-x11.nix
./mods/tailscale.nix
./mods/moonlight.nix
];
];

# Enable flakes
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];

# Bootloader
Expand Down Expand Up @@ -50,14 +50,14 @@
isNormalUser = true;
description = "Knarf";
extraGroups = [
"networkmanager"
"wheel"
"docker"
"audio"
"seat" # seatd group
"networkmanager"
"wheel"
"docker"
"audio"
"seat" # seatd group
"incus-admin"
"incus"
];
];
packages = with pkgs; [];
shell = pkgs.zsh;
};
Expand All @@ -72,6 +72,7 @@
home-manager
zsh
pciutils
gnumake
];

programs.zsh.enable = true;
Expand Down

0 comments on commit 4d27a42

Please sign in to comment.