nixos-config/flake.nix

76 lines
2.2 KiB
Nix
Raw Normal View History

2020-08-04 01:46:48 +04:00
{
description = "System configuration";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
2020-09-08 03:07:50 +04:00
nixpkgs-old.url = github:nixos/nixpkgs/840c782d507d60aaa49aa9e3f6d0b0e780912742;
# nix.url = github:nixos/nix/6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0;
2020-08-04 01:46:48 +04:00
home-manager.url = github:rycee/home-manager/bqv-flakes;
2020-08-15 19:36:16 +04:00
base16.url = github:alukardbf/base16-nix;
2020-08-10 01:17:22 +04:00
# base16.url = "/shared/nixos/base16-nix";
2020-08-04 01:46:48 +04:00
base16-horizon-scheme = {
2020-08-11 02:38:02 +04:00
url = github:michael-ball/base16-horizon-scheme;
2020-08-04 01:46:48 +04:00
flake = false;
};
materia-theme = {
url = github:nana-4/materia-theme;
flake = false;
};
zsh-autosuggestions = {
url = github:zsh-users/zsh-autosuggestions;
flake = false;
};
zsh-nix-shell = {
url = github:chisui/zsh-nix-shell;
flake = false;
};
zsh-you-should-use = {
url = github:MichaelAquilina/zsh-you-should-use;
flake = false;
};
i3lock-fancy-rapid = {
url = github:yvbbrjdr/i3lock-fancy-rapid;
flake = false;
};
spotify-tui = {
url = github:Rigellute/spotify-tui;
flake = false;
};
2020-08-07 23:27:49 +04:00
nixpkgs-mozilla = {
url = github:mozilla/nixpkgs-mozilla;
flake = false;
};
2020-08-04 01:46:48 +04:00
};
outputs = { nixpkgs, nix, self, ... }@inputs: {
nixosConfigurations = with nixpkgs.lib;
let
hosts = map (fname: builtins.head (builtins.match "(.*)\\.nix" fname))
(builtins.attrNames (builtins.readDir ./hardware-configuration));
mkHost = name:
nixosSystem {
system = "x86_64-linux";
modules = [ (import ./default.nix) ];
specialArgs = { inherit inputs name; };
};
in genAttrs hosts mkHost;
2020-08-05 04:52:30 +04:00
legacyPackages.x86_64-linux =
(builtins.head (builtins.attrValues self.nixosConfigurations)).pkgs;
2020-08-15 19:36:16 +04:00
devShell.x86_64-linux = let
pkgs = import nixpkgs { system = "x86_64-linux"; };
rebuild = pkgs.writeShellScriptBin "rebuild" ''
if [[ -z $1 ]]; then
echo "Usage: $(basename $0) {switch|boot|test}"
else
sudo nixos-rebuild $1 --flake .
fi
'';
in pkgs.mkShell {
nativeBuildInputs = [ rebuild ];
};
2020-08-04 01:46:48 +04:00
};
}