nixos-config/flake.nix

82 lines
2.6 KiB
Nix
Raw Normal View History

{
2020-04-27 05:39:00 +04:00
description =
"A collection of crap, hacks and copy-paste to make my localhosts boot";
2020-06-21 13:17:20 +04:00
inputs = {
2020-08-25 14:35:54 +04:00
nixpkgs.url = github:nixos/nixpkgs-channels/nixos-unstable;
2020-09-22 23:53:36 +04:00
# nixpkgs-mesa.url = github:nixos/nixpkgs-channels/bdac777becdbb8780c35be4f552c9d4518fe0bdb;
lambda-launcher.url = github:balsoft/lambda-launcher;
2020-06-21 13:17:20 +04:00
NUR = {
url = github:nix-community/NUR;
2020-06-21 13:17:20 +04:00
flake = false;
};
base16-unclaimed-schemes = {
url = github:chriskempson/base16-unclaimed-schemes;
2020-06-21 13:17:20 +04:00
flake = false;
};
2020-10-18 18:06:09 +04:00
home-manager.url = github:rycee/home-manager;
2020-06-21 13:17:20 +04:00
materia-theme = {
url = github:nana-4/materia-theme;
2020-06-21 13:17:20 +04:00
flake = false;
};
nixpkgs-old = {
url = github:nixos/nixpkgs/nixos-19.09;
2020-06-21 13:17:20 +04:00
flake = false;
};
weechat-scripts = {
url = github:weechat/scripts;
2020-06-21 13:17:20 +04:00
flake = false;
};
simple-nixos-mailserver = {
type = "git";
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver";
ref = "master";
flake = false;
};
nixpkgs-wayland = {
url = github:colemickens/nixpkgs-wayland;
2020-06-21 13:17:20 +04:00
flake = false;
};
weechat-notify-send = {
url = github:s3rvac/weechat-notify-send;
2020-06-21 13:17:20 +04:00
flake = false;
};
yt-utilities = {
type = "git";
url = "ssh://git@github.com/serokell/yt-utilities";
ref = "flake";
};
nixos-fhs-compat.url = github:balsoft/nixos-fhs-compat;
2020-09-18 22:31:26 +04:00
simple-osd-daemons.url = git+ssh://gitea@code.balsoft.ru/balsoft/simple-osd-daemons;
2020-06-21 13:17:20 +04:00
};
2020-06-21 13:17:20 +04:00
outputs = { nixpkgs, nix, self, ... }@inputs: {
nixosConfigurations = with nixpkgs.lib;
2020-04-27 05:39:00 +04:00
let
hosts = map (fname: builtins.head (builtins.match "(.*)\\.nix" fname))
2020-06-21 13:17:20 +04:00
(builtins.attrNames (builtins.readDir ./hardware-configuration));
2020-04-27 05:39:00 +04:00
mkHost = name:
2020-06-21 13:17:20 +04:00
nixosSystem {
system = "x86_64-linux";
modules = [ (import ./default.nix) ];
specialArgs = { inherit inputs name; };
};
2020-04-27 05:39:00 +04:00
in genAttrs hosts mkHost;
2020-07-03 12:59:36 +04:00
2020-06-21 13:17:20 +04:00
legacyPackages.x86_64-linux =
(builtins.head (builtins.attrValues self.nixosConfigurations)).pkgs;
# nix run github:serokell/deploy
# Because sudo requires local presence of my Yubikey, we have to manually activate the system
# sudo nix-env -p /nix/var/nix/profiles/system --set /nix/var/nix/profiles/per-user/balsoft/system;
# sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch
deploy = {
user = "balsoft";
nodes = builtins.mapAttrs (_: conf: {
hostname = conf.config.networking.hostName;
profiles.system.path = conf.config.system.build.toplevel;
}) self.nixosConfigurations;
2020-05-22 22:30:25 +04:00
};
2020-06-21 13:17:20 +04:00
};
}