nixos/flake.nix

116 lines
3.7 KiB
Nix

{
description = "Malte Tammena's system configuration";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs-master.url = "github:NixOS/nixpkgs/master";
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware";
inputs.nixpkgs-wayland.url = "github:colemickens/nixpkgs-wayland";
inputs.home-manager.url = "github:nix-community/home-manager";
inputs.emulator-2a.url = "github:MalteT/2a-emulator/develop";
inputs.gruvbox-material-gtk = {
url = "github:sainnhe/gruvbox-material-gtk";
flake = false;
};
inputs.rip = {
url = "github:nivekuil/rip";
flake = false;
};
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
let
system = "x86_64-linux";
username = "malte";
emulator-2a = inputs.emulator-2a.packages."${system}".emulator-2a;
bleeding-edge-overlay = self: super: {
bleeding = inputs.nixpkgs-master.legacyPackages.${system};
};
in rec {
nixosModules.lenovo-thinkpad-p1 = { pkgs, config, lib, ... }: {
imports = [
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-nvidia-disable
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd
nixos-hardware.nixosModules.common-pc-laptop-acpi_call
./system/lenovo-thinkpad-p1.nix
];
};
homeManagerConfigurations."${username}" =
home-manager.lib.homeManagerConfiguration {
inherit system username;
configuration = ./malte/home.nix;
homeDirectory = "/home/${username}";
};
nixosModules.home-manager = { pkgs, ... }: {
home-manager.verbose = true;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}".imports = [ ./malte/home.nix ];
nixpkgs.overlays = [
(import ./overlays/logisim.nix)
#(import ./overlays/tdesktop.nix)
#(import ./overlays/sway.nix)
];
};
nixosConfigurations.helix-texta = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./system/configuration.nix
./system/light-actkbd.nix
self.nixosModules.lenovo-thinkpad-p1
home-manager.nixosModules.home-manager
self.nixosModules.home-manager
({ pkgs, ... }: {
system.configurationRevision =
nixpkgs.lib.mkIf (self ? rev) self.rev;
nixpkgs.config.allowUnfree = true;
nix = {
# add binary caches
binaryCachePublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
# ...
];
binaryCaches = [
"https://cache.nixos.org"
"https://nixpkgs-wayland.cachix.org"
# ...
];
};
nixpkgs.overlays = [
# Use packages from nixpkgs-wayland
inputs.nixpkgs-wayland.overlay
# Use some packages from master while unstable is lacking behind
bleeding-edge-overlay
];
environment.systemPackages = [ emulator-2a ];
nix.registry.nixpkgs.flake = nixpkgs;
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
})
];
};
nixosConfigurations.achatina-fulica = nixpkgs.lib.nixosSystem {
modules = [
./system/achatina-fulica.nix
./system/achatina-fulica-hardware.nix
];
}
};
}