dotfiles/nix/flake.nix

160 lines
5.8 KiB
Nix
Raw Normal View History

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-21.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
2021-01-18 20:24:07 +01:00
nixpkgs-master.url = "github:NixOS/nixpkgs?ref=master";
home-manager = {
url = "github:nix-community/home-manager?ref=release-21.05";
inputs.nixpkgs.follows = "nixpkgs-unstable";
2021-01-18 20:24:07 +01:00
};
2021-01-18 11:23:15 +01:00
nixng = {
url = "github:MagicRB/NixNG";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
yusdacra-dotfiles = {
url = "github:yusdacra/nixos-config";
flake = false;
};
# PACKAGES
2021-01-18 20:24:07 +01:00
## Emacs
emacs-overlay = {
url = "git+https://github.com/nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs-unstable";
2021-01-18 20:24:07 +01:00
};
emacs = {
2021-02-01 12:00:24 +01:00
url = "github:flatwhatson/emacs?ref=pgtk-nativecomp";
2021-01-18 20:24:07 +01:00
flake = false;
};
vtermModule = {
url = "git+https://github.com/akermu/emacs-libvterm";
flake = false;
};
easy-hls-nix = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs = { self
, nixpkgs
, nixpkgs-unstable
, home-manager
, ...
}@inputs:
let
inherit (nixpkgs-unstable.lib) nixosSystem;
inherit (home-manager.lib) homeManagerConfiguration;
2021-01-10 20:05:04 +01:00
supportedSystems = [ "x86_64-linux" ]; # add "i686-linux" "aarch64-linux" back after hls is fixed
forAllSystems' = systems: f: nixpkgs.lib.genAttrs systems (system: f system);
forAllSystems = forAllSystems' supportedSystems;
in {
nixosConfigurations.omen = nixosSystem (import ./systems/omen.nix inputs);
omen = self.nixosConfigurations.omen.config.system.build.toplevel;
2021-01-18 11:23:42 +01:00
nixosConfigurations.heater = nixosSystem (import ./systems/heater.nix inputs);
heater = self.nixosConfigurations.heater.config.system.build.toplevel;
2021-01-24 17:43:50 +01:00
nixosConfigurations.tweedledee = nixosSystem (import ./systems/tweedledee.nix inputs);
tweedledee = self.nixosConfigurations.tweedledee.config.system.build.toplevel;
nixosConfigurations.tweedledum = nixosSystem (import ./systems/tweedledum.nix inputs);
tweedledum = self.nixosConfigurations.tweedledum.config.system.build.toplevel;
nixosConfigurations.toothpick = nixosSystem (import ./systems/toothpick.nix inputs);
toothpick = self.nixosConfigurations.toothpick.config.system.build.toplevel;
nixosConfigurations.mark = nixosSystem (import ./systems/mark.nix inputs);
mark = self.nixosConfigurations.mark.config.system.build.toplevel;
2021-02-05 12:05:42 +01:00
nixosConfigurations.recoveryUsb = nixosSystem (import ./systems/recovery-usb.nix inputs);
recoveryUsb = self.nixosConfigurations.recoveryUsb.config.system.build.toplevel;
2021-03-04 19:23:32 +01:00
homeConfigurations.edge = homeManagerConfiguration (import ./systems/edge.nix inputs);
edge = self.homeConfigurations.edge.activationPackage;
2021-03-04 19:23:32 +01:00
homeConfigurations.blowhole = homeManagerConfiguration (import ./systems/blowhole.nix inputs);
blowhole = self.homeConfigurations.blowhole.activationPackage;
2021-03-08 08:57:08 +01:00
allSystems =
let
pkgs = system: import nixpkgs { system = "x86_64-linux"; };
linkFarm = system: attrs:
let
pkgs' = pkgs system;
in
pkgs'.linkFarm "allSystems-${system}"
(pkgs'.lib.mapAttrsToList (n: v: { name = n; path = v; }) attrs);
nixos = name: self.nixosConfigurations.${name}.config.system.build.toplevel;
hm = name: self.homeConfigurations.${name}.activationPackage;
in
{
x86_64-linux = linkFarm "x86_64-linux"
{
omen = nixos "omen";
heater = nixos "heater";
tweedledee = nixos "tweedledee";
tweedledum = nixos "tweedledum";
toothpick = nixos "toothpick";
mark = nixos "mark";
recoveryUsb = nixos "recoveryUsb";
blowhole = hm "blowhole";
};
aarch64-linux = linkFarm "aarch64-linux"
{
edge = hm "edge";
};
};
2021-03-08 17:26:46 +01:00
overlays = {
emacs = import ./overlays/emacs/default.nix inputs;
emacsclient-remote = import ./overlays/emacsclient-remote;
gpg-key = import ./overlays/gpg-key inputs.nixng.lib;
screenshot = import ./overlays/screenshot inputs.nixng.lib;
sss-cli = import ./overlays/sss-cli inputs.sss-cli;
shh = import ./overlays/shh;
easy-hls-nix = import ./overlays/easy-hls-nix inputs.easy-hls-nix;
discord-canary = import "${inputs.yusdacra-dotfiles}/overlays/discord-canary-system.nix";
};
nixosModules = {
vault-agent = import ./nixos-modules/vault-agent.nix;
};
packages =
forAllSystems (system:
let
mkPkg'' =
pkgs: name: package:
(import pkgs { inherit system;
overlays =
nixpkgs.lib.mapAttrsToList
(_: v: v) self.overlays;
} ).magic_rb."${package}";
mkPkg' = mkPkg'' nixpkgs-unstable;
mkPkg = name: mkPkg'' nixpkgs-unstable name name;
in
2021-03-08 17:26:46 +01:00
{
emacs = mkPkg "emacs";
emacsclient-remote = mkPkg "emacsclient-remote";
gpg-key = mkPkg "gpg-key";
gpg-key-hs = mkPkg' "gpg-key" "gpg-key-hs";
screenshot = mkPkg "screenshot";
sss-cli = mkPkg "sss-cli";
shh = mkPkg "shh";
easy-hls-nix = if system == "x86_64-linux" then mkPkg "easy-hls-nix" else (import nixpkgs-unstable { inherit system; }).hello;
});
2021-03-08 08:57:08 +01:00
};
}