diff --git a/flake.nix b/flake.nix index ab27e3b..3881518 100644 --- a/flake.nix +++ b/flake.nix @@ -4,59 +4,55 @@ inputs = { # nixpkgs.url = "github:auxolotl/nixpkgs/nixos-unstable"; - lix = { - url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1"; - flake = false; - }; - lix-module = { - url = "git+https://git.lix.systems/lix-project/nixos-module"; - inputs.lix.follows = "lix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + lix = { + url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1"; + flake = false; + }; + lix-module = { + url = "git+https://git.lix.systems/lix-project/nixos-module"; + inputs.lix.follows = "lix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - sops-nix = { - url = "github:Mic92/sops-nix"; - }; + sops-nix = { + url = "github:Mic92/sops-nix"; + }; - catppuccin-vsc = { - url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz"; - }; + catppuccin-vsc = { + url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz"; + }; - solaar = { - url = "github:Svenum/Solaar-Flake/latest"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + solaar = { + url = "github:Svenum/Solaar-Flake/latest"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, lix-module, solaar, ... }@inputs: - let - system = "x86_64"; - in { - nixosConfigurations = { - default = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/default/configuration.nix - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops - lix-module.nixosModules.default - ]; - }; - kim = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/kim/configuration.nix - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops - lix-module.nixosModules.default - solaar.nixosModules.default - ]; + let + system = "x86_64"; + globals = rec { + user = "annika"; + fullName = "Annika Merris"; + gitName = fullName; + gitEmail = "me@annikamerris.com"; + nixfilesRepo = "ssh://git@forgejo.local.merr.is:2222/annika/nixos2.git"; + }; + in + { + nixosConfigurations = { + kim = import ./hosts/kim { + inherit inputs globals overlays; + }; + }; + + homeConfigurations = { + kim = nixosConfigurations.kim.config.home-manager.users.${globals.user}.home; }; }; - }; } diff --git a/hosts/kim/annika.nix b/hosts/kim/annika.nix index e5b8844..b555350 100644 --- a/hosts/kim/annika.nix +++ b/hosts/kim/annika.nix @@ -5,13 +5,14 @@ inputs.sops-nix.homeManagerModules.sops ]; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + # Configure secrets stuff sops = { defaultSopsFile = ../../secrets/secrets.yaml; defaultSopsFormat = "yaml"; age.keyFile = "/home/annika/.config/sops/age/keys.txt"; - - secrets."spotifyd/settings/global/password" = { }; }; nixpkgs.config.allowUnfree = true; @@ -20,15 +21,6 @@ home.username = "annika"; home.homeDirectory = "/home/annika"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. - # The home.packages option allows you to install Nix packages into your # environment. home.packages = [ @@ -121,6 +113,12 @@ }; }; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. } diff --git a/hosts/kim/default.nix b/hosts/kim/default.nix new file mode 100644 index 0000000..7bdb583 --- /dev/null +++ b/hosts/kim/default.nix @@ -0,0 +1,53 @@ +# Kim +# System configuration for my desktop + +{ inputs, globals, overlays, ... }: + +with inputs; + +nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + globals + home-manager.nixosModules.home-manager + # ../../modules/common + # ../../modules/nixos + { + # something with overlays, I don't get those yet. + + # Hardware + physical = true; + networking.hostName = "kim"; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; # TODO: I use wayland, do I need this? + hardware.enableRedistributableFirmware = true; + powerManagement.cpuFreqGovernor = "performance"; + hardware.cpu.amd.updateMicrocode = true; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/ba4362a3-3a0b-4227-b460-a5a9302f5966"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/DB88-8E65"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + # TODO: identityFile = "/home/${globals.user}/.ssh/id_ed2519"; + # TODO: passwordHash = nixpkgs.lib.fileContents ../../password.sha512; + + # Theming? + } + ]; +}