[NixOS] Add jay-lenovo-wsl and wsl support

This commit is contained in:
Kat Huang 2023-07-26 19:14:00 +00:00
parent 36b3ef1d9a
commit 19962bdc6e
9 changed files with 147 additions and 281 deletions

View File

@ -1,25 +1,12 @@
{ config, pkgs, options, inputs, ... }: { config, pkgs, options, inputs, ... }:
{ {
imports = [ imports = [
./nix.nix
./users.nix ./users.nix
./essential.nix ./essential.nix
./environment.nix ./environment.nix
]; ];
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
registry.nixpkgs.flake = inputs.nixpkgs;
};
nixpkgs.overlays = with inputs; [
nix.overlays.default
(import ./overlay.nix)
];
# Allow all the things
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [ nixpkgs.config.permittedInsecurePackages = [
"openssl-1.0.2u" "openssl-1.0.2u"
]; ];

View File

@ -16,6 +16,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": [ "systems": [
@ -23,11 +39,29 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1687709756, "lastModified": 1689068808,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -56,61 +90,6 @@
"type": "github" "type": "github"
} }
}, },
"gtk-sni-tray": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
],
"status-notifier-item": [
"status-notifier-item"
]
},
"locked": {
"lastModified": 1663379298,
"narHash": "sha256-m18+G7V1N+g/pPeKJG9hkblGA5c8QTnUYnsU5t14sOw=",
"owner": "taffybar",
"repo": "gtk-sni-tray",
"rev": "1927d86308d34b5d21a709cf8ff5332ec5d37de4",
"type": "github"
},
"original": {
"owner": "taffybar",
"repo": "gtk-sni-tray",
"type": "github"
}
},
"gtk-strut": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1663377859,
"narHash": "sha256-UrBd+R3NaJIDC2lt5gMafS3KBeLs83emm2YorX2cFCo=",
"owner": "taffybar",
"repo": "gtk-strut",
"rev": "d946eb230cdccf5afc063642b3215723e555990b",
"type": "github"
},
"original": {
"owner": "taffybar",
"repo": "gtk-strut",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -118,11 +97,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1687969886, "lastModified": 1690303752,
"narHash": "sha256-tC2qFLmuM0PFaw0tMHVcFmzsG/351q09qa1EpuL2n1U=", "narHash": "sha256-2YiwFHQERGoaORNORmsdmVlPD8CVVwlwbV2+f77sFhg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a7002d6bfca54742d5fc9b485a1879953b4585b9", "rev": "ba2c0737cc848db03470828fdb5e86df75ed42a8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -131,32 +110,6 @@
"type": "github" "type": "github"
} }
}, },
"imalison-taffybar": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"taffybar": [
"taffybar"
],
"xmonad": [
"xmonad"
]
},
"locked": {
"lastModified": 1,
"narHash": "sha256-FDbBPRbfABuZ92x5azeEOIayP1AVnmF1KhFEi/rTTLo=",
"path": "../../dotfiles/config/taffybar",
"type": "path"
},
"original": {
"path": "../../dotfiles/config/taffybar",
"type": "path"
}
},
"lowdown-src": { "lowdown-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -198,11 +151,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1686838567, "lastModified": 1690200740,
"narHash": "sha256-aqKCUD126dRlVSKV6vWuDCitfjFrZlkwNuvj5LtjRRU=", "narHash": "sha256-aRkEXGmCbAGcvDcdh/HB3YN+EvoPoxmJMOaqRZmf6vM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "429f232fe1dc398c5afea19a51aad6931ee0fb89", "rev": "ba9650b14e83b365fb9e731f7d7c803f22d2aecf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -211,18 +164,38 @@
"type": "github" "type": "github"
} }
}, },
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1690187332,
"narHash": "sha256-8iyH0LXszole3kUjPfg4S8uprJ0RGDQbZLyBvKFiQ3s=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "01112baf546b5577038e2a422a5215eedd9bc84b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1687898314, "lastModified": 1689605451,
"narHash": "sha256-B4BHon3uMXQw8ZdbwxRK1BmxVOGBV4viipKpGaIlGwk=", "narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e18dc963075ed115afb3e312b64643bf8fd4b474", "rev": "53657afe29748b3e462f1f892287b7e254c26d77",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixos-23.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -243,91 +216,32 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-regression_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1688001024, "lastModified": 1690179384,
"narHash": "sha256-Zf88j+DUj6rDgveWfdEyUo4fL1KZTowzPAN6gpeqzKg=", "narHash": "sha256-+arbgqFTAtoeKtepW9wCnA0njCOyoiDFyl0Q0SBSOtE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2c8591ad6a6f9d679817a94f847c59b0d1e3289e", "rev": "b12803b6d90e2e583429bb79b859ca53c348b39a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"notifications-tray-icon": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1627789093,
"narHash": "sha256-rnQ7vDF9g2xqRpw62lkCyxBiq6cXhWgfoF7lx1WoNMI=",
"owner": "IvanMalison",
"repo": "notifications-tray-icon",
"rev": "2fd47641d0cb046c78de9b4577cb30bc49e607ea",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"repo": "notifications-tray-icon",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"git-ignore-nix": "git-ignore-nix", "git-ignore-nix": "git-ignore-nix",
"gtk-sni-tray": "gtk-sni-tray",
"gtk-strut": "gtk-strut",
"home-manager": "home-manager", "home-manager": "home-manager",
"imalison-taffybar": "imalison-taffybar",
"nix": "nix", "nix": "nix",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixos-wsl": "nixos-wsl",
"nixpkgs-regression": "nixpkgs-regression_2", "nixpkgs": "nixpkgs_2",
"notifications-tray-icon": "notifications-tray-icon", "systems": "systems_2"
"status-notifier-item": "status-notifier-item",
"systems": "systems",
"taffybar": "taffybar",
"xmonad": "xmonad",
"xmonad-contrib": "xmonad-contrib"
}
},
"status-notifier-item": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1641783528,
"narHash": "sha256-wJymJfYPFj4/r1e4kT/wt9FEsyCXo5JkkcOoozpuhag=",
"owner": "taffybar",
"repo": "status-notifier-item",
"rev": "f4f9c66ab57fc42eeed0de8cfac9f5f9d30d9dc7",
"type": "github"
},
"original": {
"owner": "taffybar",
"repo": "status-notifier-item",
"type": "github"
} }
}, },
"systems": { "systems": {
@ -345,113 +259,18 @@
"type": "github" "type": "github"
} }
}, },
"taffybar": { "systems_2": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"gtk-sni-tray": [
"gtk-sni-tray"
],
"gtk-strut": [
"gtk-strut"
],
"nixpkgs": [
"nixpkgs"
],
"xmonad": [
"xmonad"
]
},
"locked": { "locked": {
"lastModified": 1685567526, "lastModified": 1681028828,
"narHash": "sha256-JvoCkRmKzdJwoHL+m29W845eJmp4bRdlYiqUabHvzhY=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "taffybar", "owner": "nix-systems",
"repo": "taffybar", "repo": "default",
"rev": "741995d09da1264da669d69c6c26fe4575c5d4ba", "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "taffybar", "owner": "nix-systems",
"ref": "master", "repo": "default",
"repo": "taffybar",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1687898314,
"narHash": "sha256-B4BHon3uMXQw8ZdbwxRK1BmxVOGBV4viipKpGaIlGwk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e18dc963075ed115afb3e312b64643bf8fd4b474",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"xmonad": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
],
"unstable": "unstable"
},
"locked": {
"lastModified": 1663511234,
"narHash": "sha256-gyIoxSygmW/d29P45kq/V1LlLlJ8jkT2D7O0OtdPcSc=",
"owner": "IvanMalison",
"repo": "xmonad",
"rev": "a2259bb3091429f4293d371e13fd5a2ee8da30db",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"ref": "master",
"repo": "xmonad",
"type": "github"
}
},
"xmonad-contrib": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"git-ignore-nix": [
"git-ignore-nix"
],
"nixpkgs": [
"nixpkgs"
],
"xmonad": [
"xmonad"
]
},
"locked": {
"lastModified": 1686731483,
"narHash": "sha256-gARNKrY2Eud5BlW8CyJVJ29owfNLZRF3Ov/QMGjCItc=",
"owner": "IvanMalison",
"repo": "xmonad-contrib",
"rev": "ac9bc49022ca7d1076d00ab87e7ecc45216117b8",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"ref": "withMyChanges",
"repo": "xmonad-contrib",
"type": "github" "type": "github"
} }
} }

View File

@ -25,6 +25,7 @@
url = github:hercules-ci/gitignore.nix; url = github:hercules-ci/gitignore.nix;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-wsl = { url = github:nix-community/NixOS-WSL; };
}; };
outputs = inputs@{ outputs = inputs@{
@ -50,7 +51,7 @@
mkConfigurationParams = filename: { mkConfigurationParams = filename: {
name = machineNameFromFilename filename; name = machineNameFromFilename filename;
value = { value = {
modules = [ (machinesPath + ("/" + filename)) ../base.nix ]; modules = [ (machinesPath + ("/" + filename)) ];
}; };
}; };
defaultConfigurationParams = defaultConfigurationParams =

View File

@ -107,6 +107,8 @@
nixpkgs-regression = { url = github:NixOS/nixpkgs; }; nixpkgs-regression = { url = github:NixOS/nixpkgs; };
nixified-ai = { url = github:nixified-ai/flake; }; nixified-ai = { url = github:nixified-ai/flake; };
nixos-wsl = { url = github:nix-community/NixOS-WSL; };
}; };
outputs = inputs@{ outputs = inputs@{
@ -138,7 +140,7 @@
mkConfigurationParams = filename: { mkConfigurationParams = filename: {
name = machineNameFromFilename filename; name = machineNameFromFilename filename;
value = { value = {
modules = [ (machinesFilepath + ("/" + filename)) ./base.nix ]; modules = [ (machinesFilepath + ("/" + filename)) ];
}; };
}; };
defaultConfigurationParams = defaultConfigurationParams =

View File

@ -3,6 +3,7 @@
imports = [ imports = [
./android.nix ./android.nix
./arm-incompatible.nix ./arm-incompatible.nix
./base.nix
./games.nix ./games.nix
./desktop.nix ./desktop.nix
./xmonad.nix ./xmonad.nix

View File

@ -1,5 +1,8 @@
{ pkgs, ... }: { pkgs, inputs, ... }:
{ {
imports = [
inputs.home-manager.nixosModule
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bitwarden bitwarden
obsidian obsidian
@ -8,6 +11,8 @@
ffmpeg ffmpeg
]; ];
networking.hostName = "jay-lenovo-wsl";
home-manager.users.kat = { pkgs, config, ... }: { home-manager.users.kat = { pkgs, config, ... }: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;

View File

@ -0,0 +1,10 @@
{ lib, pkgs, config, inputs, ... }:
{
imports = [
../wsl.nix
../kat.nix
];
wsl.defaultUser = "kat";
system.stateVersion = "22.05";
}

17
nixos/nix.nix Normal file
View File

@ -0,0 +1,17 @@
{ inputs, ... }:
{
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
registry.nixpkgs.flake = inputs.nixpkgs;
};
nixpkgs.overlays = with inputs; [
# nix.overlays.default
(import ./overlay.nix)
];
# Allow all the things
nixpkgs.config.allowUnfree = true;
}

24
nixos/wsl.nix Normal file
View File

@ -0,0 +1,24 @@
{ inputs, ... }:
{
imports = [
inputs.nixos-wsl.nixosModules.wsl
./nix.nix
./users.nix
./essential.nix
./environment.nix
];
programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
wsl = {
enable = true;
automountPath = "/mnt";
startMenuLaunchers = true;
# Enable native Docker support
# docker-native.enable = true;
# Enable integration with Docker Desktop (needs to be installed)
# docker-desktop.enable = true;
};
}