This commit is contained in:
Casper V. Kristensen 2023-08-01 16:55:53 +02:00
parent 7904c8f3c8
commit 369c3399b5
10 changed files with 42 additions and 36 deletions

View file

@ -10,20 +10,23 @@
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system
inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system
};
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system
inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system
};
};
outputs = { self, nixpkgs, ... }@inputs: {
# https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
nixosConfigurations = {
# Home desktop
omega = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs; # pass flake inputs to modules
specialArgs = inputs; # pass flake inputs to modules
modules = [
./hosts/omega
];
@ -31,7 +34,7 @@
# Laptop
zeta = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs; # pass flake inputs to modules
specialArgs = inputs; # pass flake inputs to modules
modules = [
./hosts/zeta
];

View file

@ -0,0 +1 @@

View file

@ -23,7 +23,7 @@
# 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 = "23.05"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
@ -32,5 +32,5 @@
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment?
home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment?
}

View file

@ -2,7 +2,8 @@
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
[
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
@ -14,7 +15,7 @@
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files
options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
@ -26,10 +27,10 @@
};
swapDevices = [
{
device = "/nix/persist/swapfile";
size = 16*1024; # 16 GiB
}
{
device = "/nix/persist/swapfile";
size = 16 * 1024; # 16 GiB
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -23,7 +23,7 @@
# 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 = "23.05"; # Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment?
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
@ -32,5 +32,5 @@
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment?
home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment?
}

View file

@ -2,7 +2,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
@ -14,7 +15,7 @@
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files
options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
@ -26,10 +27,10 @@
};
swapDevices = [
{
device = "/nix/persist/swapfile";
size = 8*1024; # 8 GiB
}
{
device = "/nix/persist/swapfile";
size = 8 * 1024; # 8 GiB
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -16,17 +16,17 @@
hideMounts = true;
directories = [
{ directory = "/etc/NetworkManager/system-connections"; user = "root"; group = "root"; mode = "0700"; }
{ directory = "/tmp"; user = "root"; group = "root"; mode = "1777"; } # see comment above
{ directory = "/tmp"; user = "root"; group = "root"; mode = "1777"; } # see comment above
# With great power comes great responsibility, we get it
{ directory = "/var/db/sudo/lectured"; user = "root"; group = "root"; mode = "0700"; }
{ directory = "/var/log"; user = "root"; group = "root"; mode = "0755"; }
];
files = [
"/etc/machine-id" # needed for /var/log
"/etc/machine-id" # needed for /var/log
];
users.caspervk = {
directories = [
"/" # entire home directory
"/" # entire home directory
];
};
};

View file

@ -8,11 +8,11 @@
};
environment.persistence."/nix/persist" = {
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
};
}

View file

@ -12,8 +12,8 @@
passwordFile = "/nix/persist/passwordfile";
extraGroups = [
"networkmanager"
"wheel" # allows sudo
"video" # allows controlling brightness
"wheel" # allows sudo
"video" # allows controlling brightness
# todo: docker, systemd-journal, audio, input, power, nix ?
];
uid = 1000;
@ -21,7 +21,7 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPB/qr63FB0ZqOe/iZGwIKNHD8a1Ud/mXVjQPmpIG7pM caspervk@omega"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII71DKQziktCkyMAmL25QKRK6nG2uJDkQXioIZp5JkMZ caspervk@zeta"
];
packages = with pkgs; [];
packages = with pkgs; [ ];
};
};
};

View file

@ -18,10 +18,10 @@
# Trackpad
tap = "enabled";
natural_scroll = "enable";
dwt = "disabled"; # don't disable-while-typing
dwt = "disabled"; # don't disable-while-typing
};
};
modifier = "Mod4"; # super
modifier = "Mod4"; # super
terminal = "alacritty";
workspaceAutoBackAndForth = true;
};
@ -44,7 +44,7 @@
};
# Video
programs.light.enable = true; # allows controlling screen brightness
programs.light.enable = true; # allows controlling screen brightness
# Allow sharing screen
#xdg.portal.wlr.enable = true;
@ -53,6 +53,6 @@
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [intel-media-driver ];
extraPackages = with pkgs; [ intel-media-driver ];
};
}