2024-05-07 15:37:50 -04:00
|
|
|
{
|
|
|
|
description = "Whovian9369's WSL NixOS Config";
|
|
|
|
inputs = {
|
2024-05-08 00:26:39 -04:00
|
|
|
|
2024-05-07 15:37:50 -04:00
|
|
|
### Basically required
|
|
|
|
nixpkgs = {
|
|
|
|
url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
};
|
|
|
|
|
|
|
|
nixos-wsl = {
|
|
|
|
url = "github:nix-community/NixOS-WSL/main";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-08-18 21:37:47 -04:00
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
2024-05-08 00:26:39 -04:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2024-05-07 15:37:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
### My extra inputs
|
|
|
|
|
|
|
|
agenix = {
|
|
|
|
url = "github:ryantm/agenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-05-08 00:26:39 -04:00
|
|
|
# Optional, not necessary for the module
|
2024-05-07 22:55:55 -04:00
|
|
|
inputs.darwin.follows = "";
|
2024-05-08 00:26:39 -04:00
|
|
|
# Optionally choose not to download darwin deps
|
2024-05-07 22:55:55 -04:00
|
|
|
# (saves some resources on Linux)
|
2024-05-08 00:26:39 -04:00
|
|
|
inputs.systems.follows = "nix-systems_default";
|
2024-05-11 03:52:59 -04:00
|
|
|
inputs.home-manager.follows = "home-manager";
|
2024-05-07 15:37:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-05-07 22:55:55 -04:00
|
|
|
xil = {
|
|
|
|
url = "github:Qyriad/Xil";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-05-08 00:26:39 -04:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
|
2024-05-08 15:35:46 -04:00
|
|
|
nix-index-database = {
|
|
|
|
url = "github:nix-community/nix-index-database";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-06-29 05:47:29 -04:00
|
|
|
aaru = {
|
|
|
|
url = "github:Whovian9369/aaru-nix-flake";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-09-02 02:11:36 -04:00
|
|
|
rom-properties = {
|
|
|
|
url = "github:Whovian9369/rom-properties-nix-flake";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-10-24 01:24:22 -04:00
|
|
|
ninfs = {
|
|
|
|
url = "github:ihaveamac/ninfs";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
|
2024-05-29 21:46:22 -04:00
|
|
|
### Lix! Lix! Lix!
|
2024-05-18 19:32:04 -04:00
|
|
|
|
|
|
|
lix = {
|
2024-06-25 04:39:23 -04:00
|
|
|
url = "git+https://git@git.lix.systems/lix-project/lix";
|
|
|
|
/*
|
|
|
|
Future me, the pattern for using Forgejo URLs is:
|
|
|
|
git+https://git@${domain}/${user_org}/${repo}?ref=refs/tags/${TAG}
|
|
|
|
git+https://git@${domain}/${user_org}/${repo}?rev=${commitHash}
|
|
|
|
*/
|
2024-08-18 21:37:47 -04:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
2024-05-18 19:32:04 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
lix-module = {
|
|
|
|
url = "git+https://git.lix.systems/lix-project/nixos-module";
|
2024-06-25 04:39:23 -04:00
|
|
|
/*
|
|
|
|
Future me, the pattern for using Forgejo URLs is:
|
|
|
|
git+https://git@${domain}/${user_org}/${repo}?ref=refs/tags/${TAG}
|
|
|
|
git+https://git@${domain}/${user_org}/${repo}?rev=${commitHash}
|
|
|
|
*/
|
2024-05-18 19:32:04 -04:00
|
|
|
inputs.lix.follows = "lix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
|
2024-05-08 00:26:39 -04:00
|
|
|
#########
|
|
|
|
# Extra inputs that I am adding just to make my life easier,
|
|
|
|
# but don't like that they're included >:(
|
|
|
|
#########
|
|
|
|
|
2024-11-26 12:44:08 -05:00
|
|
|
/*
|
|
|
|
Used by:
|
|
|
|
- lix
|
|
|
|
- nixos-wsl
|
|
|
|
*/
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Used by:
|
|
|
|
- lix-module
|
|
|
|
- ninfs
|
|
|
|
- Itself
|
|
|
|
- inputs.pyctr
|
|
|
|
- nixos-wsl
|
|
|
|
- xil
|
|
|
|
*/
|
2024-05-08 00:26:39 -04:00
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
inputs.systems.follows = "nix-systems_default";
|
2024-05-07 22:55:55 -04:00
|
|
|
};
|
2024-05-08 00:26:39 -04:00
|
|
|
|
2024-11-26 12:44:08 -05:00
|
|
|
/*
|
|
|
|
Used by:
|
|
|
|
- agenix
|
|
|
|
- flake-utils
|
|
|
|
*/
|
2024-05-08 00:26:39 -04:00
|
|
|
nix-systems_default = {
|
|
|
|
url = "github:nix-systems/default";
|
|
|
|
};
|
|
|
|
|
2024-08-18 21:37:47 -04:00
|
|
|
|
2024-05-07 15:37:50 -04:00
|
|
|
}; # inputs
|
|
|
|
|
2024-05-08 15:35:46 -04:00
|
|
|
outputs = {
|
|
|
|
# Needed
|
|
|
|
self, nixpkgs, nixos-wsl,
|
2024-05-18 19:32:04 -04:00
|
|
|
# Lix
|
2024-08-18 21:37:47 -04:00
|
|
|
lix, lix-module,
|
2024-05-11 01:40:59 -04:00
|
|
|
# Added by me
|
2024-10-24 01:24:22 -04:00
|
|
|
aaru, agenix, home-manager, ninfs, nix-index-database, rom-properties, xil, ... }:
|
2024-05-18 03:34:23 -04:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2024-06-09 05:05:25 -04:00
|
|
|
|
2024-10-24 01:24:22 -04:00
|
|
|
inherit (import ./system/common/sshKeys.nix) mySSHKeys;
|
2024-05-18 03:34:23 -04:00
|
|
|
in
|
2024-05-07 15:37:50 -04:00
|
|
|
{
|
2024-06-15 02:59:06 -04:00
|
|
|
# Notes
|
|
|
|
/*
|
|
|
|
$ nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
|
|
|
should let me build the system config without calling "nixos-rebuild"
|
|
|
|
|
|
|
|
$ nix build .#nixosConfigurations.nixos-wsl.config.system.build.toplevel
|
|
|
|
should let me build the "nixos-wsl" system config.
|
|
|
|
|
|
|
|
How to build ISO:
|
|
|
|
Building .#nixosConfigurations.isoimage-pc.config.system.build.isoImage
|
2024-08-09 19:08:42 -04:00
|
|
|
should build ISO to "result" (or other set) symlink.
|
2024-06-15 02:59:06 -04:00
|
|
|
Alternatively, use:
|
|
|
|
- nix build -L .#packages.x86_64-linux.build_isoimage-pc
|
|
|
|
- nix build -L .#build_isoimage-pc
|
2024-09-03 03:54:25 -04:00
|
|
|
|
|
|
|
How to use config in an install:
|
|
|
|
Mount partitions.
|
2024-09-04 00:15:51 -04:00
|
|
|
$ sudo nixos-install -v --root /mnt --flake "github:Whovian9369/whovian_nixos_config#CONFIG_NAME"
|
2024-09-04 01:58:26 -04:00
|
|
|
Example for nixosConfigurations.piplup:
|
|
|
|
$ sudo nixos-install -v --root /mnt --flake "github:Whovian9369/whovian_nixos_config#piplup"
|
2024-06-15 02:59:06 -04:00
|
|
|
*/
|
2024-06-09 05:05:25 -04:00
|
|
|
|
2024-05-07 15:37:50 -04:00
|
|
|
nixosConfigurations = {
|
|
|
|
nixos-wsl = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2024-10-24 01:24:22 -04:00
|
|
|
specialArgs = {
|
|
|
|
inherit aaru agenix home-manager ninfs nix-index-database xil rom-properties mySSHKeys;
|
|
|
|
};
|
2024-05-07 15:37:50 -04:00
|
|
|
modules = [
|
2024-10-24 01:24:22 -04:00
|
|
|
./system/shared_imports.nix
|
|
|
|
./system/nixos-wsl/main.nix
|
2024-06-14 16:33:54 -04:00
|
|
|
# ./system/dotnet_os_codename-workaround.nix
|
2024-05-29 15:27:25 -04:00
|
|
|
# Source of this fix file is
|
2024-06-10 21:19:37 -04:00
|
|
|
# https://github.com/nazarewk-iac/nix-configs
|
|
|
|
# /modules/ascii-workaround.nix
|
2024-05-07 15:37:50 -04:00
|
|
|
nixos-wsl.nixosModules.wsl
|
2024-05-18 19:32:04 -04:00
|
|
|
lix-module.nixosModules.default
|
2024-05-07 15:37:50 -04:00
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{
|
2024-05-14 04:04:51 -04:00
|
|
|
system.configurationRevision = self.shortRev or self.dirtyShortRev or "dirty";
|
2024-05-07 15:37:50 -04:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-06-02 05:56:30 -04:00
|
|
|
|
2024-11-18 16:24:15 -05:00
|
|
|
# Expected Next Desktop
|
2024-10-24 01:24:22 -04:00
|
|
|
chimchar = nixpkgs.lib.nixosSystem {
|
2024-06-02 05:55:42 -04:00
|
|
|
system = "x86_64-linux";
|
2024-10-24 01:24:22 -04:00
|
|
|
specialArgs = {
|
|
|
|
# inherit aaru home-manager xil;
|
|
|
|
# inherit agenix nix-index-database rom-properties mySSHKeys;
|
|
|
|
inherit aaru agenix home-manager ninfs nix-index-database xil rom-properties mySSHKeys;
|
|
|
|
};
|
2024-06-02 05:55:42 -04:00
|
|
|
modules = [
|
2024-10-24 01:24:22 -04:00
|
|
|
./system/shared_imports.nix
|
|
|
|
./system/chimchar/main.nix
|
|
|
|
lix-module.nixosModules.default
|
|
|
|
home-manager.nixosModules.home-manager
|
2024-06-02 05:55:42 -04:00
|
|
|
{
|
2024-10-24 01:24:22 -04:00
|
|
|
system.configurationRevision = self.shortRev or self.dirtyShortRev or "dirty";
|
2024-06-02 05:55:42 -04:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-06-04 21:47:21 -04:00
|
|
|
|
2024-11-18 16:24:15 -05:00
|
|
|
# Currently for VMs
|
2024-09-04 01:58:26 -04:00
|
|
|
piplup = nixpkgs.lib.nixosSystem {
|
2024-07-28 00:55:20 -04:00
|
|
|
system = "x86_64-linux";
|
2024-10-24 01:24:22 -04:00
|
|
|
specialArgs = {
|
|
|
|
inherit aaru agenix home-manager ninfs nix-index-database xil rom-properties mySSHKeys;
|
|
|
|
};
|
2024-07-28 00:55:20 -04:00
|
|
|
modules = [
|
2024-10-24 01:24:22 -04:00
|
|
|
./system/shared_imports.nix
|
|
|
|
./system/piplup/main.nix
|
2024-07-28 00:55:20 -04:00
|
|
|
# ./system/dotnet_os_codename-workaround.nix
|
|
|
|
# Source of this fix file is
|
|
|
|
# https://github.com/nazarewk-iac/nix-configs
|
|
|
|
# /modules/ascii-workaround.nix
|
|
|
|
lix-module.nixosModules.default
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{
|
|
|
|
system.configurationRevision = self.shortRev or self.dirtyShortRev or "dirty";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-11-18 16:24:15 -05:00
|
|
|
# Mainly for that broken Dell XPS
|
2024-09-07 01:42:22 -04:00
|
|
|
nixps = nixpkgs.lib.nixosSystem {
|
2024-10-24 01:24:22 -04:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./system/shared_imports.nix
|
|
|
|
./system/nixps/main.nix
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{
|
|
|
|
system.configurationRevision = self.shortRev or self.dirtyShortRev or "dirty";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-11-18 16:24:15 -05:00
|
|
|
# I love being able to generate
|
2024-10-24 01:24:22 -04:00
|
|
|
isoimage-pc = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = { inherit mySSHKeys; };
|
|
|
|
modules = [
|
|
|
|
./system/isoimage-pc/main.nix
|
|
|
|
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-05-07 15:37:50 -04:00
|
|
|
};
|
2024-05-18 03:30:33 -04:00
|
|
|
|
2024-11-18 16:24:15 -05:00
|
|
|
formatter.x86_64-linux = pkgs.nixfmt-rfc-style;
|
2024-09-07 01:38:32 -04:00
|
|
|
/*
|
|
|
|
Some options:
|
|
|
|
- nixpkgs.legacyPackages.x86_64-linux.alejandra
|
2024-10-24 01:24:22 -04:00
|
|
|
- nixpkgs.legacyPackages.x86_64-linux.nixfmt
|
2024-09-07 01:38:32 -04:00
|
|
|
- nixpkgs.legacyPackages.x86_64-linux.nixfmt-classic
|
|
|
|
- nixpkgs.legacyPackages.x86_64-linux.treefmt
|
|
|
|
- Didn't figure it out
|
|
|
|
- Seems too... "Meh"
|
|
|
|
|
|
|
|
Related but not formatters:
|
|
|
|
- nixpkgs.legacyPackages.x86_64-linux.deadnix
|
|
|
|
*/
|
|
|
|
|
2024-05-18 03:30:33 -04:00
|
|
|
packages.x86_64-linux = {
|
2024-08-15 02:51:53 -04:00
|
|
|
binaryobjectscanner = pkgs.callPackage ./home/packages/binaryobjectscanner/package.nix {};
|
2024-08-24 04:43:41 -04:00
|
|
|
hactoolnet = pkgs.callPackage ./home/packages/hactoolnet/package.nix {};
|
|
|
|
hactoolnet-bin = pkgs.callPackage ./home/packages/hactoolnet/bin.nix {};
|
2024-05-18 03:34:23 -04:00
|
|
|
ird_tools = pkgs.callPackage ./home/packages/ird_tools/package.nix {};
|
2024-08-15 02:51:53 -04:00
|
|
|
irdkit = pkgs.callPackage ./home/packages/irdkit/package.nix {};
|
2024-07-06 03:59:17 -04:00
|
|
|
nxtik = pkgs.callPackage ./home/packages/nxtik/package.nix {};
|
2024-05-18 05:44:36 -04:00
|
|
|
ps3dec = pkgs.callPackage ./home/packages/ps3dec/package.nix {};
|
2024-08-30 00:07:19 -04:00
|
|
|
psfo = pkgs.callPackage ./home/packages/psfo/package.nix {};
|
2024-08-15 02:51:53 -04:00
|
|
|
sabretools = pkgs.callPackage ./home/packages/sabretools/package.nix {};
|
2024-09-02 02:11:36 -04:00
|
|
|
|
2024-08-18 21:37:47 -04:00
|
|
|
new_rclone = pkgs.rclone.overrideAttrs ( oldAttrs: {
|
2024-05-28 23:43:52 -04:00
|
|
|
patches = [ ./home/packages/new_rclone/patches/rclone_8ffe3e462cbf5688c37c54009db09d8dcb486860.diff ];
|
2024-08-18 21:37:47 -04:00
|
|
|
} );
|
|
|
|
new_nix-init = pkgs.nix-init.overrideAttrs (oldAttrs: {
|
|
|
|
patches = [ ./home/packages/nix-init/default_to_package.diff ];
|
|
|
|
} );
|
2024-08-15 02:51:53 -04:00
|
|
|
|
2024-06-10 21:21:16 -04:00
|
|
|
build_isoimage-pc = self.nixosConfigurations.isoimage-pc.config.system.build.isoImage;
|
2024-08-18 21:37:47 -04:00
|
|
|
external_lix = lix.packages.x86_64-linux.nix;
|
2024-10-24 01:24:22 -04:00
|
|
|
# external_xil = xil.packages.x86_64-linux.xil;
|
|
|
|
# external_aaru = aaru.packages.x86_64-linux.git;
|
|
|
|
# external_rom-properties = rom-properties.packages.x86_64-linux.default;
|
2024-05-18 03:30:33 -04:00
|
|
|
};
|
2024-05-07 15:37:50 -04:00
|
|
|
};
|
|
|
|
}
|