Setup nix on new SSD

This commit is contained in:
Julian Mutter 2023-08-31 09:36:49 +02:00
parent 90a6060978
commit 8c800ed66e
3 changed files with 58 additions and 30 deletions

View File

@ -4,7 +4,8 @@
{ config, pkgs, ... }:
{
let python-packages = ps: with ps; [ ];
in rec {
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
@ -131,7 +132,7 @@
uid = 1000;
group = "julian";
shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" ];
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
hunspell
hunspellDicts.de_DE
@ -152,16 +153,16 @@
};
users.groups.julian = { gid = 1000; };
users.groups.wolfi = { gid = 1001; };
# users.groups.wolfi = { gid = 1001; };
users.users.wolfi = {
isNormalUser = true;
description = "Wolfi";
uid = 1001;
group = "wolfi";
shell = pkgs.fish;
extraGroups = [ "networkmanager" "wheel" ];
};
# users.users.wolfi = {
# isNormalUser = true;
# description = "Wolfi";
# uid = 1001;
# group = "wolfi";
# shell = pkgs.fish;
# extraGroups = [ "networkmanager" "wheel" ];
# };
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -198,11 +199,15 @@
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
(pkgs.python3.withPackages python-packages)
firefox
thunderbird
nextcloud-client
qalculate-gtk
libqalculate
schildichat-desktop
tdesktop
@ -300,6 +305,11 @@
poppler_utils # Pdf utils including pdfimages
matlab # Using nix-matlab overlay defined in flake
sage
devbox
parted
du-dust # Like du tree but better
];
nixpkgs.overlays = [
@ -321,6 +331,8 @@
source-code-pro
];
virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

18
nix/flake.lock generated
View File

@ -22,11 +22,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1693148476,
"narHash": "sha256-1TOqS+BnFgb+6H4XlVPb2y32rTSYh+dNnxHqFQz08s4=",
"lastModified": 1693407679,
"narHash": "sha256-UeeXQk/PNmmFEeZ/hcpB8fyT6jjVUTYPtKicHThxmIw=",
"owner": "doronbehar",
"repo": "nix-matlab",
"rev": "e5ae42eec5bc093f0a414ce86f7349dc9e43648f",
"rev": "bf537f8ae01effaebb3f5c6bdc6ab842faac6b2e",
"type": "gitlab"
},
"original": {
@ -37,11 +37,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1693060755,
"narHash": "sha256-KNsbfqewEziFJEpPR0qvVz4rx0x6QXxw1CcunRhlFdk=",
"lastModified": 1693355128,
"narHash": "sha256-+ZoAny3ZxLcfMaUoLVgL9Ywb/57wP+EtsdNGuXUJrwg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c66ccfa00c643751da2fd9290e096ceaa30493fc",
"rev": "a63a64b593dcf2fe05f7c5d666eb395950f36bc9",
"type": "github"
},
"original": {
@ -51,11 +51,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1693003285,
"narHash": "sha256-5nm4yrEHKupjn62MibENtfqlP6pWcRTuSKrMiH9bLkc=",
"lastModified": 1693377291,
"narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5690c4271f2998c304a45c91a0aeb8fb69feaea7",
"rev": "e7f38be3775bab9659575f192ece011c033655f0",
"type": "github"
},
"original": {

View File

@ -8,33 +8,49 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usbhid" "uas" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/7469546c-44d6-44a7-aecd-28aae51c84ca";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/5A58-A8EB";
fsType = "vfat";
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/232d00ae-a844-4b59-97e9-d7248ff179a4";
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
swapDevices = [ { device = "/swapfile"; } ];
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
# fileSystems."/swap" =
# { device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
# fsType = "btrfs";
# options = [ "subvol=swap" "noatime" ];
# };
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/7D48-A59C";
fsType = "vfat";
};
swapDevices = [ ];
# swapDevices = [ { device = "/swapfile"; } ];
# 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.docker0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";