This commit is contained in:
Alexander Bantyev 2020-04-27 04:39:00 +03:00
parent ea72d681ef
commit d4fe3fa099
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
16 changed files with 426 additions and 108 deletions

View File

@ -9,16 +9,15 @@
# 3. ./install or ./bootstrap # 3. ./install or ./bootstrap
# 4. Log in to application and services where neccesary # 4. Log in to application and services where neccesary
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, name, ... }:
let sources = import ./nix/sources.nix; rec {
in rec {
imports = [ imports = [
"${./hardware-configuration}/${device}.nix" (./hardware-configuration + "/${name}.nix")
"${sources.home-manager}/nixos" inputs.home-manager.nixosModules.home-manager
(import ./modules device) (import ./modules device)
]; ];
device = builtins.replaceStrings ["\n"] [""] (builtins.readFile /etc/hostname); device = name;
system.stateVersion = "18.03"; system.stateVersion = "18.03";
} }

276
flake.lock generated Normal file
View File

@ -0,0 +1,276 @@
{
"nodes": {
"NUR": {
"info": {
"lastModified": 1587939076,
"narHash": "sha256-UI/Q4YXvhEoYYulOV6MnAx7dSuQYhQEN1OhGw/wD6mI="
},
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"owner": "nix-community",
"repo": "NUR",
"rev": "f0119b0c3041be14a7113b2e24b46b3c458377e4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"base16-unclaimed-schemes": {
"flake": false,
"info": {
"lastModified": 1527170198,
"narHash": "sha256-YV2tgexpyeLqm6d8WaBwT9QPAHT/gxhiFpxQq03xdhA="
},
"locked": {
"owner": "chriskempson",
"repo": "base16-unclaimed-schemes",
"rev": "d6b93456dc1012628faec572387814f59e0b854a",
"type": "github"
},
"original": {
"owner": "chriskempson",
"repo": "base16-unclaimed-schemes",
"type": "github"
}
},
"home-manager": {
"info": {
"lastModified": 1587442074,
"narHash": "sha256-SmC1aP9TJImzHlNIWOTa+uwePeHoEcfGJEewXXWAtfc="
},
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"owner": "rycee",
"repo": "home-manager",
"rev": "e13bd1e79372c58cc1e86e45bdf304f4b6770fe3",
"type": "github"
},
"original": {
"owner": "rycee",
"ref": "bqv-flakes",
"repo": "home-manager",
"type": "github"
}
},
"materia-theme": {
"flake": false,
"info": {
"lastModified": 1587550712,
"narHash": "sha256-RMifAu3dpSpXu4AdWXwO+zFgr7OHhgsj5oHOAfPNVF8="
},
"locked": {
"owner": "nana-4",
"repo": "materia-theme",
"rev": "b36b379c9256b67e5f63a60c6faf6912f1845b66",
"type": "github"
},
"original": {
"owner": "nana-4",
"repo": "materia-theme",
"type": "github"
}
},
"mtxclient": {
"flake": false,
"info": {
"lastModified": 1578915159,
"narHash": "sha256-cwQT5j4ClrHCfMXF6g8RXS4WCMkg+rpfdjpH3SZQBY4="
},
"locked": {
"owner": "nheko-reborn",
"repo": "mtxclient",
"rev": "84c6778cc367bca79755e73e77b2cc69950375b2",
"type": "github"
},
"original": {
"owner": "nheko-reborn",
"ref": "84c6778cc367bca79755e73e77b2cc69950375b2",
"repo": "mtxclient",
"type": "github"
}
},
"nheko": {
"flake": false,
"info": {
"lastModified": 1579642615,
"narHash": "sha256-kdfoWPVJp1KkyYHX0FlLCQydi2x3qarKYxJx9vmoLuU="
},
"locked": {
"owner": "nheko-reborn",
"repo": "nheko",
"rev": "1943d1c74d5253ec9d2b7ee38f69d791d28e84c1",
"type": "github"
},
"original": {
"owner": "nheko-reborn",
"ref": "1943d1c74d5253ec9d2b7ee38f69d791d28e84c1",
"repo": "nheko",
"type": "github"
}
},
"nixpkgs": {
"info": {
"narHash": "sha256-OnpEWzNxF/AU4KlqBXM2s5PWvfI5/BS6xQrPvkF5tO8="
},
"locked": {
"owner": "edolstra",
"repo": "nixpkgs",
"rev": "7f8d4b088e2df7fdb6b513bc2d6941f1d422a013",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs-old": {
"flake": false,
"info": {
"lastModified": 1581379743,
"narHash": "sha256-i1XCn9rKuLjvCdu2UeXKzGLF6IuQePQKFt4hEKRU5oc="
},
"locked": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "34c7eb7545d155cc5b6f499b23a7cb1c96ab4d59",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-19.03",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-wayland": {
"flake": false,
"info": {
"lastModified": 1587858280,
"narHash": "sha256-dDxUVUFMw3TGdiGVUT+QU0wRL1bleYmtvNf3Ah8aw14="
},
"locked": {
"owner": "colemickens",
"repo": "nixpkgs-wayland",
"rev": "724ac75779a1d411e89ebe0ab4aab721e0af525b",
"type": "github"
},
"original": {
"owner": "colemickens",
"repo": "nixpkgs-wayland",
"type": "github"
}
},
"nixpkgs_2": {
"info": {
"lastModified": 1587944902,
"narHash": "sha256-DS4R0WC23hcfTTuxb3b3lMdTQYaK5z/d+1ue9ZHUdtE="
},
"locked": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "92d9d07c61d06c044af0261ab1741340151e4d3b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"info": {
"lastModified": 1587944902,
"narHash": "sha256-DS4R0WC23hcfTTuxb3b3lMdTQYaK5z/d+1ue9ZHUdtE="
},
"locked": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "92d9d07c61d06c044af0261ab1741340151e4d3b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"NUR": "NUR",
"base16-unclaimed-schemes": "base16-unclaimed-schemes",
"home-manager": "home-manager",
"materia-theme": "materia-theme",
"mtxclient": "mtxclient",
"nheko": "nheko",
"nixpkgs": "nixpkgs_3",
"nixpkgs-old": "nixpkgs-old",
"nixpkgs-wayland": "nixpkgs-wayland",
"simple-nixos-mailserver": "simple-nixos-mailserver",
"weechat-notify-send": "weechat-notify-send",
"weechat-scripts": "weechat-scripts"
}
},
"simple-nixos-mailserver": {
"flake": false,
"info": {
"lastModified": 1587594197,
"narHash": "sha256-h1WOSGZ9y2HktNLBypphNovFIWuZ/on+WO0XFF72EPU=",
"revCount": 409
},
"locked": {
"ref": "master",
"rev": "899d68ac7ab8580ff0ca05860bf81381ae172ae3",
"type": "git",
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver"
},
"original": {
"ref": "master",
"type": "git",
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver"
}
},
"weechat-notify-send": {
"flake": false,
"info": {
"lastModified": 1584284218,
"narHash": "sha256-Fj9FuT1Q97yZMvAvH9oGZJWO8d1QutwBhDalPlRrQnA="
},
"locked": {
"owner": "s3rvac",
"repo": "weechat-notify-send",
"rev": "3390f91a3af23fc49ebb77771d78732501738241",
"type": "github"
},
"original": {
"owner": "s3rvac",
"repo": "weechat-notify-send",
"type": "github"
}
},
"weechat-scripts": {
"flake": false,
"info": {
"lastModified": 1585408181,
"narHash": "sha256-ytASrd9KqlB2vdeF/0CLgXPJrw+FU7m5BtHljVncErY="
},
"locked": {
"owner": "weechat",
"repo": "scripts",
"rev": "5955bc4cabe8bdfa0c6b5f5ecfbe23df6e5560c1",
"type": "github"
},
"original": {
"owner": "weechat",
"repo": "scripts",
"type": "github"
}
}
},
"root": "root",
"version": 5
}

101
flake.nix
View File

@ -1,12 +1,103 @@
{ {
description = "A flake for building Hello World"; description =
"A collection of crap, hacks and copy-paste to make my localhosts boot";
edition = 201909; edition = 201909;
outputs = { self, nixpkgs }: { inputs = {
nixpkgs = {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; type = "github";
owner = "nixos";
repo = "nixpkgs-channels";
ref = "nixos-unstable";
};
NUR = {
type = "github";
owner = "nix-community";
repo = "NUR";
flake = false;
};
base16-unclaimed-schemes = {
type = "github";
owner = "chriskempson";
repo = "base16-unclaimed-schemes";
flake = false;
};
home-manager = {
type = "github";
owner = "rycee";
repo = "home-manager";
ref = "bqv-flakes";
};
materia-theme = {
type = "github";
owner = "nana-4";
repo = "materia-theme";
flake = false;
};
mtxclient = {
type = "github";
owner = "nheko-reborn";
repo = "mtxclient";
ref = "84c6778cc367bca79755e73e77b2cc69950375b2";
flake = false;
};
nheko = {
type = "github";
owner = "nheko-reborn";
repo = "nheko";
ref = "1943d1c74d5253ec9d2b7ee38f69d791d28e84c1";
flake = false;
};
nixpkgs-old = {
type = "github";
owner = "nixos";
repo = "nixpkgs";
ref = "nixos-19.03";
flake = false;
};
weechat-scripts = {
type = "github";
owner = "weechat";
repo = "scripts";
flake = false;
};
simple-nixos-mailserver = {
type = "git";
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver";
ref = "master";
flake = false;
};
nixpkgs-wayland = {
type = "github";
owner = "colemickens";
repo = "nixpkgs-wayland";
flake = false;
};
weechat-notify-send = {
type = "github";
owner = "s3rvac";
repo = "weechat-notify-send";
flake = false;
};
secrets = {
type = "path";
path = "./secret.nix";
flake = false;
};
};
outputs = { nixpkgs, ... }@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;
}; };
} }

View File

@ -1,33 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, ... }:
{ {
imports = imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> [ "${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ];
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/nvme0n1p2"; device = "/dev/nvme0n1p2";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-label/Home"; device = "/dev/disk/by-label/Home";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/nvme0n1p1"; device = "/dev/nvme0n1p1";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
nix.maxJobs = lib.mkDefault 16; nix.maxJobs = lib.mkDefault 16;

View File

@ -1,4 +0,0 @@
{...}:
{
}

View File

@ -1,12 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, ... }:
{ {
imports = imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> [ "${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ];
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];

View File

@ -1,12 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, ... }:
{ {
imports = imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> [ "${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix" ];
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { pkgs, config, inputs, ... }:
let let
weechat = pkgs.weechat.override { weechat = pkgs.weechat.override {
configure = { availablePlugins, ... }: { configure = { availablePlugins, ... }: {
@ -11,10 +11,10 @@ in {
"${(import ../../nix/sources.nix).weechat-notify-send}/notify_send.py"; "${(import ../../nix/sources.nix).weechat-notify-send}/notify_send.py";
home.file.".weechat/perl/autoload/multiline.pl".source = home.file.".weechat/perl/autoload/multiline.pl".source =
"${pkgs.imports.scripts}/perl/multiline.pl"; "${inputs.weechat-scripts}/perl/multiline.pl";
home.file.".weechat/python/autoload/go.py".source = home.file.".weechat/python/autoload/go.py".source =
"${pkgs.imports.scripts}/python/go.py"; "${inputs.weechat-scripts}/python/go.py";
home.file.".weechat/plugins.conf".text = '' home.file.".weechat/plugins.conf".text = ''
[var] [var]

View File

@ -10,6 +10,6 @@
since = "1997-11-19"; since = "1997-11-19";
severity = "Info"; severity = "Info";
}; };
home.packages = [ pkgs.yt-utilities ]; # home.packages = [ pkgs.yt-utilities ];
}; };
} }

View File

@ -4,7 +4,6 @@ device:
./applications/packages.nix ./applications/packages.nix
./applications/emacs ./applications/emacs
./applications/konsole.nix ./applications/konsole.nix
# ./applications/trojita.nix
./applications/sylpheed.nix ./applications/sylpheed.nix
./applications/weechat.nix ./applications/weechat.nix
./applications/okular.nix ./applications/okular.nix

View File

@ -1,24 +1,18 @@
{ pkgs, config, lib, inputs, ... }:
let let
imports = import ../nix/sources.nix;
new = import imports.nixpkgs-unstable { config.allowUnfree = true; };
filterGit = filterGit =
builtins.filterSource (type: name: name != ".git" || type != "directory"); builtins.filterSource (type: name: name != ".git" || type != "directory");
old = import imports.nixpkgs-old { }; old = import inputs.nixpkgs-old ({ config = config.nixpkgs.config; localSystem = { system = "x86_64-linux"; }; });
in { pkgs, config, lib, ... }: { in
{
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: (self: super:
rec { rec {
inherit imports; nur = (import inputs.NUR { pkgs = old; nurpkgs = pkgs; }).repos;
unstable = new;
nur = (import imports.NUR { pkgs = old; }).repos;
inherit (nur.balsoft.pkgs) termNote lambda-launcher nix-patch; inherit (nur.balsoft.pkgs) termNote lambda-launcher nix-patch;
inherit (import imports.niv { }) niv; all-hies = import inputs.all-hies { };
all-hies = import imports.all-hies { };
yt-utilities = yt-utilities =
import (self.fetchgit config.secrets.yt-utilities.source) { }; import (self.fetchgit config.secrets.yt-utilities.source) { };
@ -39,7 +33,7 @@ in { pkgs, config, lib, ... }: {
"-DBoost_LIBRARY_DIR_RELEASE=${pkgs.boost170}" "-DBoost_LIBRARY_DIR_RELEASE=${pkgs.boost170}"
]; ];
version = "0.3.0"; version = "0.3.0";
src = imports.mtxclient; src = inputs.mtxclient;
}); });
nheko = super.nheko.overrideAttrs (oa: rec { nheko = super.nheko.overrideAttrs (oa: rec {
@ -65,39 +59,9 @@ in { pkgs, config, lib, ... }: {
]; ];
pname = "nheko"; pname = "nheko";
version = "0.7.0"; version = "0.7.0";
src = imports.nheko; src = inputs.nheko;
}); });
sway-unwrapped =
(new.sway-unwrapped.override { wlroots = wlroots'; }).overrideAttrs
(oa: rec {
name = "${pname}-${version}";
pname = "sway";
version = "master";
patches = [ ];
src = imports.sway;
});
wlroots' = new.wlroots.overrideAttrs (oa: rec {
name = "${pname}-${version}";
outputs = [ "out" ];
postFixup = "true";
postInstall = "true";
pname = "wlroots";
patches = [ ];
version = "master";
src = imports.wlroots;
});
wl-clipboard = new.wl-clipboard.overrideAttrs (oa: rec {
name = "${pname}-${version}";
pname = "wl-clipboard";
version = "master";
src = imports.wl-clipboard;
});
inherit (new) kanshi mautrix-whatsapp cachix;
nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd; nerdfonts = nur.balsoft.pkgs.roboto-mono-nerd;
mpd-mpris = super.mpd-mpris.overrideAttrs mpd-mpris = super.mpd-mpris.overrideAttrs
@ -108,7 +72,7 @@ in { pkgs, config, lib, ... }: {
pythonPackages = super.pythonPackages.override { pythonPackages = super.pythonPackages.override {
overrides = (self: super: { overrides = (self: super: {
pykka2 = super.pykka.overridePythonAttrs (oa: { pykka2 = super.pykka.overridePythonAttrs (oa: {
src = imports.pykka; src = inputs.pykka;
version = "2.0.1"; version = "2.0.1";
name = "pykka-2.0.1"; name = "pykka-2.0.1";
}); });
@ -124,13 +88,12 @@ in { pkgs, config, lib, ... }: {
} else } else
{ })) { }))
]; ];
nixpkgs.pkgs = import imports.nixpkgs { nixpkgs.config = {
config.allowUnfree = true; allowUnfree = true;
config.android_sdk.accept_license = true; android_sdk.accept_license = true;
config.firefox.enablePlasmaBrowserIntegration = true; firefox.enablePlasmaBrowserIntegration = true;
} // config.nixpkgs.config; };
environment.etc.nixpkgs.source = inputs.nixpkgs;
environment.etc.nixpkgs.source = imports.nixpkgs;
nix = rec { nix = rec {
nixPath = lib.mkForce [ nixPath = lib.mkForce [
"nixpkgs=/etc/nixpkgs" "nixpkgs=/etc/nixpkgs"
@ -146,5 +109,9 @@ in { pkgs, config, lib, ... }: {
[ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
package = pkgs.nixFlakes; package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
}; };
} }

View File

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, inputs, ... }:
with lib; with lib;
with types; with types;
let let
@ -89,7 +89,7 @@ in rec {
}; };
}; };
config = let config = let
secretnix = import ../secret.nix; secretnix = import inputs.secrets;
secrets = if isNull secretnix then secrets = if isNull secretnix then
mapAttrs (n: v: null) options.secrets mapAttrs (n: v: null) options.secrets
else else

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, ... }:
with lib; with lib;
let let
colorType = types.str; colorType = types.str;
@ -62,7 +62,7 @@ in {
}; };
config = { config = {
themes.colors = fromBase16 (fromYAML (builtins.readFile themes.colors = fromBase16 (fromYAML (builtins.readFile
"${pkgs.imports.base16-unclaimed-schemes}/irblack.yaml")); "${inputs.base16-unclaimed-schemes}/irblack.yaml"));
# themes.colors = { # themes.colors = {
# bg = "#114c00"; # bg = "#114c00";
# bg = "#000000"; # bg = "#000000";

View File

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, inputs, ... }:
let let
thm = config.themes.colors; thm = config.themes.colors;
thm' = builtins.mapAttrs (name: value: builtins.substring 1 7 value) thm; thm' = builtins.mapAttrs (name: value: builtins.substring 1 7 value) thm;
@ -30,7 +30,7 @@ in {
nixpkgs.overlays = [(self: super: { nixpkgs.overlays = [(self: super: {
generated-gtk-theme = self.stdenv.mkDerivation rec { generated-gtk-theme = self.stdenv.mkDerivation rec {
name = "generated-gtk-theme"; name = "generated-gtk-theme";
src = pkgs.imports.materia-theme; src = inputs.materia-theme;
buildInputs = with self; [ sassc bc which inkscape optipng ]; buildInputs = with self; [ sassc bc which inkscape optipng ];
installPhase = '' installPhase = ''
HOME=/build HOME=/build

6
vm
View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
[[ -z ./secret.nix ]] && echo null > secret.nix
nixpkgs=$(nix eval --raw "(with import ./nix/sources.nix; nixpkgs)")
NIX_PATH=nixpkgs=$nixpkgs:nixos-config=./vm.nix nix build -f $nixpkgs/nixos vm
./result/bin/run-NixOS-VM-vm -m size=4G # Sorry, my apps are way too large

1
vm.nix
View File

@ -1 +0,0 @@
import ./. "NixOS-VM"