From e164097f36e23c5619314d197240c3ff3c92f5f7 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Thu, 30 Jan 2025 14:17:43 -0800 Subject: [PATCH] Add wixos --- flake.lock | 55 +++++++++++++++++++++++++++++++- flake.nix | 15 ++++++++- machines/wixos/configuration.nix | 30 +++++++++++++++++ 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 machines/wixos/configuration.nix diff --git a/flake.lock b/flake.lock index 38399a0..1971964 100644 --- a/flake.lock +++ b/flake.lock @@ -39,6 +39,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -82,7 +98,43 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1736095716, + "narHash": "sha256-csysw/Szu98QDiA2lhWk9seYOyCebeVEWL89zh1cduM=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "63c3b4ed1712a3a0621002cd59bfdc80875ecbb0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1733384649, + "narHash": "sha256-K5DJ2LpPqht7K76bsxetI+YHhGGRyVteTPRQaIIKJpw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "190c31a89e5eec80dd6604d7f9e5af3802a58a13", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1735834308, "narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=", @@ -125,7 +177,8 @@ "inputs": { "home-manager": "home-manager", "nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened", - "nixpkgs": "nixpkgs", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_2", "plasma-manager": "plasma-manager", "sops-nix": "sops-nix" } diff --git a/flake.nix b/flake.nix index 029ab06..2bc547a 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; sops-nix = { url = "github:Mic92/sops-nix"; @@ -26,7 +27,7 @@ }; }; - outputs = { self, nixpkgs, ... } @ inputs: let + outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let baseModules = [ ./roles inputs.sops-nix.nixosModules.sops @@ -72,5 +73,17 @@ } ]; }; + + nixosConfigurations.wixos = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = baseModules ++ [ + nixos-wsl.nixosModules.default + ./machines/wixos/configuration.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.users.johno = import ./home/home-default.nix; + } + ]; + }; }; } diff --git a/machines/wixos/configuration.nix b/machines/wixos/configuration.nix new file mode 100644 index 0000000..b22bb77 --- /dev/null +++ b/machines/wixos/configuration.nix @@ -0,0 +1,30 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://github.com/nix-community/NixOS-WSL + +{ config, lib, pkgs, ... }: + +{ + imports = [ + ]; + + networking.hostName = "wixos"; + + wsl.enable = true; + wsl.defaultUser = "johno"; + wsl.startMenuLaunchers = true; + wsl.useWindowsDriver = true; + wsl.wslConf.network.hostname = "wixos"; + wsl.wslConf.user.default = "johno"; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # 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 = "24.05"; # Did you read the comment? +}