begin work on other system configs
This commit is contained in:
11
flake.nix
11
flake.nix
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
outputs = {nixpkgs, ...} @ inputs:
|
outputs = {nixpkgs, ...} @ inputs:
|
||||||
{
|
{
|
||||||
nixosConfigurations.homebox = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.homebox = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs;};
|
specialArgs = {inherit inputs;};
|
||||||
modules = [
|
modules = [
|
||||||
|
|
||||||
@@ -50,5 +50,14 @@
|
|||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
|
modules = [
|
||||||
|
|
||||||
|
./system-config/configuration/laptop
|
||||||
|
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,117 +2,101 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
options.sysconfig.laptop.enable = lib.options.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.sysconfig.laptop.enable {
|
|
||||||
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = !config.sysconfig.homebox.enable;
|
|
||||||
message = "sysconfig.laptop conflicts with homebox!";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
|
||||||
kernelParams = [ "snd-intel-dspcfg.dsp_driver=1" ];
|
|
||||||
};
|
};
|
||||||
|
kernelParams = [ "snd-intel-dspcfg.dsp_driver=1" ];
|
||||||
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
#graphics.enable = true;
|
#graphics.enable = true;
|
||||||
|
|
||||||
opengl = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nvidia = {
|
nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
powerManagement.finegrained = false;
|
powerManagement.finegrained = false;
|
||||||
open = false;
|
open = false;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
|
|
||||||
prime = {
|
prime = {
|
||||||
# Make sure to use the correct Bus ID values for your system!
|
# Make sure to use the correct Bus ID values for your system!
|
||||||
intelBusId = "PCI:0:2:0";
|
intelBusId = "PCI:0:2:0";
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
# WARNING: sync and offload are mutually exclusive.
|
# WARNING: sync and offload are mutually exclusive.
|
||||||
# You can only pick one!!
|
# You can only pick one!!
|
||||||
#sync.enable = true;
|
#sync.enable = true;
|
||||||
offload = {
|
offload = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableOffloadCmd = true;
|
enableOffloadCmd = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
#enable bluetooth
|
#enable bluetooth
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
|
|
||||||
pulseaudio.enable = false;
|
pulseaudio.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
sysconfig.opts = {
|
sysconfig.opts = {
|
||||||
openssh.enable = false;
|
openssh.enable = false;
|
||||||
steam.enable = true;
|
steam.enable = true;
|
||||||
pipewire.enable = true;
|
pipewire.enable = true;
|
||||||
ags.enable = true;
|
ags.enable = true;
|
||||||
hyprland.enable = true;
|
hyprland.enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
nh.enable = true;
|
nh.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
videoDrivers = ["nvidia"];
|
videoDrivers = ["nvidia"];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
services.displayManager.enable = true;
|
||||||
|
|
||||||
services.displayManager.enable = true;
|
services.avahi = {
|
||||||
|
|
||||||
services.avahi = {
|
enable = true;
|
||||||
|
ipv4 = true;
|
||||||
|
ipv6 = true;
|
||||||
|
openFirewall = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
wideArea = true;
|
||||||
|
|
||||||
enable = true;
|
};
|
||||||
ipv4 = true;
|
|
||||||
ipv6 = true;
|
|
||||||
openFirewall = true;
|
|
||||||
nssmdns4 = true;
|
|
||||||
wideArea = true;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
|
||||||
environment.shells = with pkgs; [ zsh ];
|
environment.shells = with pkgs; [ zsh ];
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
programs.adb.enable = true;
|
programs.adb.enable = true;
|
||||||
|
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
@@ -120,7 +104,6 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
5
system-config/configuration/live/default.nix
Normal file
5
system-config/configuration/live/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }: {
|
||||||
|
|
||||||
|
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
}
|
||||||
71
system-config/configuration/live/disko.nix
Normal file
71
system-config/configuration/live/disko.nix
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
device ? throw "Set this to your disk device, e.g. /dev/sda",
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
inherit device;
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
boot = {
|
||||||
|
name = "boot";
|
||||||
|
size = "1M";
|
||||||
|
type = "EF02";
|
||||||
|
};
|
||||||
|
esp = {
|
||||||
|
name = "ESP";
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
name = "root";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "root_vg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
lvm_vg = {
|
||||||
|
root_vg = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs = {
|
||||||
|
root = {
|
||||||
|
size = "100%FREE";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = ["-f"];
|
||||||
|
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/persist" = {
|
||||||
|
mountOptions = ["subvol=persist" "noatime"];
|
||||||
|
mountpoint = "/persist";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = ["subvol=nix" "noatime"];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
{
|
|
||||||
description = "install nixos declaratively";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
|
||||||
|
|
||||||
disko = {
|
|
||||||
url = "github:nix-community/disko";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { ... }@inputs: let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
devices = {
|
|
||||||
main = "/dev/nvme0n1";
|
|
||||||
bonus.disk1 = "/dev/nvme1n1";
|
|
||||||
};
|
|
||||||
|
|
||||||
pkgs = import inputs.nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
|
|
||||||
nixosConfigurations.homebox = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
|
|
||||||
inherit system;
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
inputs.impermanence.nixosModules.impermanece
|
|
||||||
./disko
|
|
||||||
./impermanece
|
|
||||||
];
|
|
||||||
|
|
||||||
sysconfig.opts = {
|
|
||||||
inherit devices;
|
|
||||||
};
|
|
||||||
|
|
||||||
disko = {
|
|
||||||
enable = true;
|
|
||||||
impermanent = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
nix.settings = {
|
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
substituters = ["https://hyprland.cachix.org"];
|
|
||||||
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "homebox";
|
|
||||||
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users."nathan" = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Nathan";
|
|
||||||
initialPassword = "7567";
|
|
||||||
extraGroups = [ "wheel" "networkmanager" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.openssh.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
home-manager
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user