diff --git a/flake.lock b/flake.lock index 86d640a..3422f45 100644 --- a/flake.lock +++ b/flake.lock @@ -393,7 +393,8 @@ "nixpkgs": "nixpkgs_2", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", - "swayfx": "swayfx" + "swayfx": "swayfx", + "wsl": "wsl" } }, "rust-overlay": { @@ -486,6 +487,30 @@ "repo": "default", "type": "github" } + }, + "wsl": { + "inputs": { + "flake-compat": [], + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707476384, + "narHash": "sha256-9YortZTCO9r7wFHX92t+npUDmD5VcKrkVmwaPCvEiXI=", + "owner": "nix-community", + "repo": "nixos-wsl", + "rev": "76ca59d8d4423b27c0238bc31401692ebc571365", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-wsl", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6c50bdf..9156de0 100644 --- a/flake.nix +++ b/flake.nix @@ -16,8 +16,8 @@ host = "sashimi"; system = "aarch64-darwin"; username = "winston"; - extraModules = [inputs.nekowinston-nur.darwinModules.default]; isGraphical = true; + extraModules = [inputs.nekowinston-nur.darwinModules.default]; } { host = "futomaki"; @@ -26,10 +26,11 @@ isGraphical = true; } { - host = "bento"; + host = "yuba"; system = "x86_64-linux"; - username = "w"; - isGraphical = true; + username = "winston"; + isGraphical = false; + extraModules = [inputs.wsl.nixosModules.default]; } ]; imports = [inputs.pre-commit-hooks.flakeModule]; @@ -112,6 +113,12 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + wsl = { + url = "github:nix-community/nixos-wsl"; + inputs.flake-compat.follows = ""; + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nur.url = "github:nix-community/nur"; caarlos0-nur = { diff --git a/home/apps/git.nix b/home/apps/git.nix index 80262dc..2db89ca 100644 --- a/home/apps/git.nix +++ b/home/apps/git.nix @@ -53,6 +53,7 @@ ]; extraConfig = { + core.fsmonitor = "rs-git-fsmonitor"; credential.helper = "gopass"; init.defaultBranch = "main"; push.default = "current"; diff --git a/machines/bento/default.nix b/machines/bento/default.nix deleted file mode 100644 index 643bc3e..0000000 --- a/machines/bento/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - pkgs, - ... -}: { - imports = [./hardware.nix]; - - boot = { - kernelPackages = pkgs.linuxPackages_latest; - kernelParams = ["quiet" "splash"]; - }; - - hardware = { - bluetooth.enable = true; - }; - - networking = { - hostName = "bento"; - networkmanager.enable = true; - firewall.enable = true; - }; - - time.timeZone = "Europe/Vienna"; - i18n.defaultLocale = "en_US.UTF-8"; - - services = { - openssh.enable = true; - pcscd.enable = true; - }; - - virtualisation.podman.enable = true; -} diff --git a/machines/bento/hardware.nix b/machines/bento/hardware.nix deleted file mode 100644 index ba3a065..0000000 --- a/machines/bento/hardware.nix +++ /dev/null @@ -1,66 +0,0 @@ -# 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, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sr_mod"]; - boot.initrd.kernelModules = ["dm-snapshot"]; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - - boot.loader.systemd-boot.consoleMode = "0"; - - boot.initrd.luks.devices = { - luksroot = { - device = "/dev/disk/by-uuid/1af1c538-b38a-43f3-9ad2-9da8a946db7f"; - preLVM = true; - allowDiscards = true; - }; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/83c767e9-9efd-4f85-990d-e5cfb9200167"; - fsType = "btrfs"; - options = ["subvol=root" "compress=zstd"]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/83c767e9-9efd-4f85-990d-e5cfb9200167"; - fsType = "btrfs"; - options = ["subvol=home" "compress=zstd"]; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/83c767e9-9efd-4f85-990d-e5cfb9200167"; - fsType = "btrfs"; - options = ["subvol=nix" "compress=zstd" "noatime"]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/9382-B533"; - fsType = "vfat"; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/fd70f74e-f2a8-4117-a2c0-355736b162e0";} - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/machines/common/linux/default.nix b/machines/common/linux/default.nix index 13d381a..18e468a 100644 --- a/machines/common/linux/default.nix +++ b/machines/common/linux/default.nix @@ -39,8 +39,6 @@ programs.zsh.enable = true; environment.systemPackages = [pkgs.xdg-utils]; - system.stateVersion = "22.11"; - # enable yubikey u2f support security.pam.u2f = { enable = true; diff --git a/machines/common/wsl/default.nix b/machines/common/wsl/default.nix new file mode 100644 index 0000000..34618df --- /dev/null +++ b/machines/common/wsl/default.nix @@ -0,0 +1,12 @@ +{ + lib, + pkgs, + ... +}: { + services.kanata.enable = lib.mkForce false; + + system = { + build.installBootLoader = lib.mkForce "${pkgs.coreutils}/bin/true"; + stateVersion = "23.11"; + }; +} diff --git a/machines/futomaki/default.nix b/machines/futomaki/default.nix index db5b555..c0a1830 100644 --- a/machines/futomaki/default.nix +++ b/machines/futomaki/default.nix @@ -6,7 +6,6 @@ imports = [./hardware.nix]; networking = { - hostName = "futomaki"; networkmanager.enable = true; firewall.enable = true; }; @@ -60,4 +59,6 @@ }; }; }; + + system.stateVersion = "22.11"; } diff --git a/machines/lib.nix b/machines/lib.nix index 3eee568..b3c921f 100644 --- a/machines/lib.nix +++ b/machines/lib.nix @@ -68,6 +68,9 @@ description = "Whether the system is a graphical target"; }; }; + config = { + networking.hostName = host; + }; } ./common/shared ./common/${hostPlatform} diff --git a/machines/sashimi/default.nix b/machines/sashimi/default.nix index ac894c6..357e981 100644 --- a/machines/sashimi/default.nix +++ b/machines/sashimi/default.nix @@ -1,9 +1,6 @@ { imports = [./brew.nix]; - networking.computerName = "sashimi"; - networking.hostName = "sashimi"; - nix.settings.extra-platforms = [ "aarch64-darwin" "x86_64-darwin" diff --git a/machines/yuba/default.nix b/machines/yuba/default.nix new file mode 100644 index 0000000..cdcb310 --- /dev/null +++ b/machines/yuba/default.nix @@ -0,0 +1,7 @@ +{ + imports = [../common/wsl]; + wsl = { + defaultUser = "winston"; + enable = true; + }; +}