System/flake.nix

205 lines
5.5 KiB
Nix
Raw Normal View History

2021-12-20 13:37:26 -05:00
{
description = "Nathan's system configurations";
inputs = {
2022-05-30 21:47:04 -04:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
2021-12-20 13:37:26 -05:00
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
2022-05-17 00:18:49 -04:00
inputs.nixpgks.follows = "nixpkgs";
2021-12-20 13:37:26 -05:00
};
emacs = {
2022-06-23 02:57:41 -04:00
url = "github:nix-community/emacs-overlay";
2022-05-25 04:48:14 -04:00
inputs.nixpkgs.follows = "nixpkgs";
2022-01-26 16:53:39 -05:00
};
mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
2021-12-20 13:37:26 -05:00
};
2022-05-17 00:18:49 -04:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-22.05";
2022-05-17 00:18:49 -04:00
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-04-19 19:39:39 -04:00
polymc = {
url = "github:PolyMC/PolyMC";
2022-06-01 13:02:33 -04:00
inputs.nixpkgs.follows = "nixpkgs";
2022-04-19 19:39:39 -04:00
};
2022-04-21 15:18:47 -04:00
nix-doom-emacs = {
url = "github:nix-community/nix-doom-emacs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.emacs-overlay.follows = "emacs";
};
2022-06-14 01:00:09 -04:00
java = {
url = "github:nathans-flakes/java";
inputs.nixpkgs.follows = "nixpkgs";
};
quilt-server = {
url = "github:forward-progress/quilt-server-nix-container";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-07-06 01:42:31 -04:00
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-08-01 18:10:41 -04:00
gamescope = {
url = "github:nathans-flakes/gamescope";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:t184256/nix-on-droid";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
2021-12-20 13:37:26 -05:00
};
outputs =
{ self
, nixpkgs
, nixpkgs-unstable
, fenix
, emacs
, mozilla
, sops-nix
, home-manager
, darwin
, polymc
, nix-doom-emacs
2022-06-14 01:00:09 -04:00
, java
, quilt-server
2022-07-06 01:42:31 -04:00
, nixos-generators
, wsl
2022-08-01 18:10:41 -04:00
, gamescope
, nix-on-droid
2022-06-23 02:57:41 -04:00
}@inputs:
2021-12-23 00:45:21 -05:00
let
2022-06-23 02:57:41 -04:00
makeNixosSystem = { system, hostName, extraModules ? [ ], ourNixpkgs ? nixpkgs }: ourNixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inputs = inputs;
2022-05-18 01:09:25 -04:00
};
2022-06-23 02:57:41 -04:00
modules = [
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
2022-09-04 01:59:56 -04:00
./modules/linux/default.nix
({ pkgs, lib, config, ... }: {
2022-06-23 02:57:41 -04:00
# Configure hostname
networking = {
hostName = hostName;
};
# Setup sops
# Add default secrets
sops = {
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = (pkg: true);
# Home manager configuration
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inputs = inputs;
nixosConfig = config;
2022-06-23 02:57:41 -04:00
};
sharedModules = [
2022-09-04 02:54:15 -04:00
./home-manager/linux/default.nix
2022-06-23 02:57:41 -04:00
];
};
})
] ++ extraModules;
};
2021-12-23 00:45:21 -05:00
in
2022-06-23 02:57:41 -04:00
rec {
2022-07-06 01:42:31 -04:00
# Real systems
nixosConfigurations = {
2022-06-23 02:57:41 -04:00
levitation = makeNixosSystem {
system = "x86_64-linux";
2022-06-23 02:57:41 -04:00
hostName = "levitation";
extraModules = [
./hardware/levitation.nix
2022-07-03 00:43:50 -04:00
./machines/levitation/configuration.nix
2022-06-23 02:57:41 -04:00
];
2022-05-13 22:36:53 -04:00
};
oracles = makeNixosSystem {
system = "x86_64-linux";
hostName = "oracles";
extraModules = [
./hardware/oracles.nix
./machines/oracles/configuration.nix
];
};
2022-06-23 02:57:41 -04:00
x86vm = makeNixosSystem {
2022-05-14 01:09:02 -04:00
system = "x86_64-linux";
2022-06-23 02:57:41 -04:00
hostName = "x86vm";
extraModules = [
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
2022-07-03 00:43:50 -04:00
./machines/x86vm/configuration.nix
];
2021-12-23 00:47:40 -05:00
};
2022-07-06 01:42:31 -04:00
# WSL sytem
wsl = makeNixosSystem {
system = "x86_64-linux";
hostName = "wsl";
extraModules = [
wsl.nixosModules.wsl
./machines/wsl/configuration.nix
];
};
};
# Android systems
nixOnDroidConfigurations = {
tablet = nix-on-droid.lib.nixOnDroidConfiguration {
config = ./machines/tablet/configuration.nix;
system = "aarch64-linux";
2022-09-04 02:46:27 -04:00
extraModules = [
./modules/nix-on-droid/default.nix
2022-09-04 03:21:18 -04:00
({ pkgs, lib, config, ... }: {
# Home manager configuration
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inputs = inputs;
nixosConfig = config;
};
sharedModules = [
2022-09-04 03:30:59 -04:00
./home-manager/nix-on-droid/default.nix
2022-09-04 03:21:18 -04:00
];
};
})
2022-09-04 02:46:27 -04:00
];
};
};
2022-07-06 01:42:31 -04:00
packages = {
x86_64-linux = {
# Hyper-V image
hyperv = nixos-generators.nixosGenerate {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
./machines/hyperv/configuration.nix
];
format = "hyperv";
};
};
2021-12-23 00:47:40 -05:00
};
2021-12-20 13:37:26 -05:00
};
}