nixos-config/flake.nix

99 lines
2.8 KiB
Nix
Raw Normal View History

{
2020-04-27 04:39:00 +03:00
description =
"A collection of crap, hacks and copy-paste to make my localhosts boot";
2020-06-21 12:17:20 +03:00
inputs = {
2021-01-21 21:13:53 +03:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
lambda-launcher.url = "github:balsoft/lambda-launcher";
2021-01-23 22:21:51 +03:00
deploy-rs.url = "github:serokell/deploy-rs";
2021-03-10 18:53:44 +03:00
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
2020-06-21 12:17:20 +03:00
NUR = {
2021-01-21 21:13:53 +03:00
url = "github:nix-community/NUR";
2020-06-21 12:17:20 +03:00
flake = false;
};
base16-unclaimed-schemes = {
2021-01-21 21:13:53 +03:00
url = "github:chriskempson/base16-unclaimed-schemes";
2020-06-21 12:17:20 +03:00
flake = false;
};
2021-01-21 21:13:53 +03:00
home-manager.url = "github:rycee/home-manager";
2020-06-21 12:17:20 +03:00
materia-theme = {
2021-01-21 21:13:53 +03:00
url = "github:nana-4/materia-theme";
2020-06-21 12:17:20 +03:00
flake = false;
};
nixpkgs-old = {
2021-01-21 21:13:53 +03:00
url = "github:nixos/nixpkgs/nixos-19.09";
2020-06-21 12:17:20 +03:00
flake = false;
};
simple-nixos-mailserver = {
2020-11-10 01:07:06 +03:00
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
2020-06-21 12:17:20 +03:00
flake = false;
};
nixpkgs-wayland = {
2021-01-21 21:13:53 +03:00
url = "github:colemickens/nixpkgs-wayland";
2020-06-21 12:17:20 +03:00
flake = false;
};
yt-utilities = {
type = "git";
url = "ssh://git@github.com/serokell/yt-utilities";
ref = "flake";
};
2021-01-21 21:13:53 +03:00
nixos-fhs-compat.url = "github:balsoft/nixos-fhs-compat";
simple-osd-daemons.url = "github:balsoft/simple-osd-daemons";
2021-03-11 01:57:37 +03:00
emacs-overlay.url = "github:nix-community/emacs-overlay";
2021-03-18 17:10:07 +03:00
sonoff-lan = {
url = "github:AlexxIT/SonoffLAN";
flake = false;
};
2021-03-30 14:05:31 +03:00
crdt = {
url = "git+https://code.librehq.com/qhong/crdt.el";
flake = false;
};
2021-05-19 01:13:25 +03:00
himalaya.url = "github:soywod/himalaya";
2021-06-08 19:35:21 +03:00
impermanence.url = "github:nix-community/impermanence";
2020-06-21 12:17:20 +03:00
};
2021-01-23 22:21:51 +03:00
outputs = { nixpkgs, nix, self, deploy-rs, ... }@inputs: {
2021-01-21 21:13:53 +03:00
nixosModules = import ./modules;
nixosProfiles = import ./profiles;
2020-06-21 12:17:20 +03:00
nixosConfigurations = with nixpkgs.lib;
2020-04-27 04:39:00 +03:00
let
2021-01-21 21:13:53 +03:00
hosts = builtins.attrNames (builtins.readDir ./machines);
2020-04-27 04:39:00 +03:00
mkHost = name:
2020-06-21 12:17:20 +03:00
nixosSystem {
2021-01-21 21:13:53 +03:00
system = builtins.readFile (./machines + "/${name}/system");
2021-01-23 22:21:51 +03:00
modules = [ (import (./machines + "/${name}")) { device = name; } ];
2021-01-21 21:13:53 +03:00
specialArgs = { inherit inputs; };
2020-06-21 12:17:20 +03:00
};
2020-04-27 04:39:00 +03:00
in genAttrs hosts mkHost;
2020-07-03 11:59:36 +03:00
2020-06-21 12:17:20 +03:00
legacyPackages.x86_64-linux =
(builtins.head (builtins.attrValues self.nixosConfigurations)).pkgs;
2021-01-23 22:21:51 +03:00
defaultApp = deploy-rs.defaultApp;
2021-03-10 18:53:44 +03:00
devShell.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux;
mkShell {
buildInputs = [
nix.defaultPackage.x86_64-linux
deploy-rs.defaultPackage.x86_64-linux
nixfmt
];
};
2020-06-21 12:17:20 +03:00
deploy = {
2021-01-23 22:21:51 +03:00
user = "root";
nodes.T420-Laptop = {
hostname =
self.nixosConfigurations.T420-Laptop.config.networking.hostName;
profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.T420-Laptop;
};
2020-05-22 21:30:25 +03:00
};
2020-06-21 12:17:20 +03:00
};
}