structural-rework #1

Merged
ghoscht merged 44 commits from structural-rework into main 2023-12-29 10:35:45 +01:00
6 changed files with 79 additions and 42 deletions
Showing only changes of commit 6ef0dca25f - Show all commits

View file

@ -7,43 +7,43 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685599623, "lastModified": 1703113038,
"narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=", "narHash": "sha256-oxkyzjpD+mNT7arzU/zHrkNHLuY9tKwmnD2MNaZiSDw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd", "rev": "0c2353d5d930c3d93724df6858aef064a31b3c00",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05", "ref": "release-23.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1686431482, "lastModified": 1703068421,
"narHash": "sha256-oPVQ/0YP7yC2ztNsxvWLrV+f0NQ2QAwxbrZ+bgGydEM=", "narHash": "sha256-WSw5Faqlw75McIflnl5v7qVD/B3S2sLh+968bpOGrWA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d3bb401dcfc5a46ce51cdfb5762e70cc75d082d2", "rev": "d65bceaee0fb1e64363f7871bc43dc1c6ecad99f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-23.05", "ref": "nixos-23.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1686501370, "lastModified": 1697059129,
"narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=", "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519", "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,14 +3,14 @@
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# You can access packages and modules from different nixpkgs revs # You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example: # at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# Home manager # Home manager
home-manager.url = "github:nix-community/home-manager/release-23.05"; home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
# TODO: Add any other flake you might need # TODO: Add any other flake you might need
@ -59,12 +59,10 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = { nixosConfigurations = {
# FIXME replace with your hostname adalbert = nixpkgs.lib.nixosSystem {
your-hostname = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = {inherit inputs outputs;};
modules = [ modules = [
# > Our main nixos configuration file < ./hosts/adalbert
./nixos/configuration.nix
]; ];
}; };
}; };
@ -72,13 +70,11 @@
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
# FIXME replace with your username@hostname "ghoscht@adalbert" = home-manager.lib.homeManagerConfiguration {
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;}; extraSpecialArgs = {inherit inputs outputs;};
modules = [ modules = [
# > Our main home-manager configuration file < ./home/ghoscht/adalbert.nix
./home-manager/home.nix
]; ];
}; };
}; };

View file

@ -42,15 +42,27 @@
config = { config = {
# Disable if you don't want unfree packages # Disable if you don't want unfree packages
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [
"electron-24.8.6" #fixes Feishin & Webcord
];
# Workaround for https://github.com/nix-community/home-manager/issues/2942 # Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = _: true; allowUnfreePredicate = _: true;
}; };
}; };
# TODO: Set your username nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes" "repl-flake"];
warn-dirty = false;
};
};
home = { home = {
username = "your-username"; username = lib.mkDefault "ghoscht";
homeDirectory = "/home/your-username"; homeDirectory = lib.mkDefault "/home/${config.home.username}";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
stateVersion = "23.11";
}; };
# Add stuff for your user as you see fit: # Add stuff for your user as you see fit:
@ -63,7 +75,4 @@
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.05";
} }

View file

@ -73,8 +73,7 @@
# FIXME: Add the rest of your current configuration # FIXME: Add the rest of your current configuration
# TODO: Set your hostname networking.hostName = "adalbert";
networking.hostName = "your-hostname";
# TODO: This is just an example, be sure to use whatever bootloader you prefer # TODO: This is just an example, be sure to use whatever bootloader you prefer
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -82,11 +81,11 @@
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed. # TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users.users = { users.users = {
# FIXME: Replace with your username # FIXME: Replace with your username
your-username = { ghoscht = {
# TODO: You can set an initial password for your user. # TODO: You can set an initial password for your user.
# If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install.
# Be sure to change it (using passwd) after rebooting! # Be sure to change it (using passwd) after rebooting!
initialPassword = "correcthorsebatterystaple"; initialPassword = "yoi";
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
@ -109,5 +108,5 @@
}; };
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.05"; system.stateVersion = "23.11";
} }

View file

@ -0,0 +1,43 @@
# 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" "nvme" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/f9ba57fb-0b82-47e0-8189-7bbebc530e2b";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/BCF2-51D4";
fsType = "vfat";
};
swapDevices = [
{device = "/dev/disk/by-uuid/4834fbc3-3feb-4b93-b11f-8b9bd054c5c1";}
];
# 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.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,10 +0,0 @@
# This is just an example, you should generate yours with nixos-generate-config and put it in here.
{
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
# Set your system kind (needed for flakes)
nixpkgs.hostPlatform = "x86_64-linux";
}