Make project buildable

This commit is contained in:
Oystein Kristoffer Tveit 2022-08-16 03:24:06 +02:00
parent c109b193a9
commit 68c1ee2656
7 changed files with 57 additions and 60 deletions

View File

@ -34,8 +34,8 @@
"fonts": { "fonts": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1649003599, "lastModified": 1651945262,
"narHash": "sha256-QtT+ansp3ombpdS2+jNWgZKSqpxhVq3cyrpAKkDzA9Y=", "narHash": "sha256-7r0hq5G/HjK6yVOt18VKaxuJcGM6GPu/jmwbkksJ7LE=",
"path": "/home/h7x4/git/fonts", "path": "/home/h7x4/git/fonts",
"type": "path" "type": "path"
}, },
@ -51,11 +51,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1654113405, "lastModified": 1656169755,
"narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", "rev": "4a3d01fb53f52ac83194081272795aa4612c2381",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -67,11 +67,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1655456688, "lastModified": 1660496378,
"narHash": "sha256-j2trI5gv2fnHdfUQFBy957avCPxxzCqE8R+TOYHPSRE=", "narHash": "sha256-sgAhmrC1iSnl5T2VPPiMpciH1aRw5c7PYEdXX6jd6Gk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d17a56d90ecbd1b8fc908d49598fb854ef188461", "rev": "879121648fe522b38cc1cf75aef160a14a1f2e7b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -99,7 +99,10 @@
}, },
"locked": { "locked": {
"lastModified": 1649874484, "lastModified": 1649874484,
"narHash": "sha256-NM+o+vIZ91hLG+C9iJCuho0Zj8BqZRC0Ttrn6cn+qCQ=", "narHash": "sha256-gRo+xTefhEyqdHnUQihtjf1R6zFuHIHTtsTdjglWFI8=",
"ref": "main",
"rev": "9fffae0bad5225b508f1ee8cc98ac64603ed4410",
"revCount": 25,
"type": "git", "type": "git",
"url": "file:///home/h7x4/git/nix-secrets" "url": "file:///home/h7x4/git/nix-secrets"
}, },
@ -111,11 +114,11 @@
"vscode-server": { "vscode-server": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1648830510, "lastModified": 1658079296,
"narHash": "sha256-U+UGKbZajc2NqDvBL7hCYshAiaXgiBv5rNFIqLl0X7M=", "narHash": "sha256-xnUCsRKi06dJpKFxNCeMsmzkyek4teGGzjYYR+vYI7c=",
"owner": "msteen", "owner": "msteen",
"repo": "nixos-vscode-server", "repo": "nixos-vscode-server",
"rev": "d2343b5eb47b811856085f3eff4d899a32b2c136", "rev": "867d5691871acc039fb47d45018c69e9ac751d95",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,8 +1,8 @@
{ pkgs, config, inputs, secrets, ... }: { pkgs, config, inputs, secrets, ... }:
let let
inherit (pkgs) lib; inherit (pkgs) lib;
inherit (specialArgs) machineVars; # inherit (specialArgs) machineVars;
# inherit (config) machineVars; inherit (config) machineVars;
# has_graphics = !config.machineVars.headless; # has_graphics = !config.machineVars.headless;
in { in {
nixpkgs.config = { nixpkgs.config = {
@ -11,7 +11,7 @@ in {
nix = { nix = {
package = pkgs.nixFlakes; package = pkgs.nixFlakes;
distributedBuilds = machineVars.hostname != "Tsuki"; distributedBuilds = config.networking.hostName != "Tsuki";
binaryCaches = [ binaryCaches = [
"https://cache.nixos.org/" "https://cache.nixos.org/"
]; ];
@ -92,12 +92,6 @@ in {
dash dash
]; ];
systemPackages = with pkgs; [
wget
] ++ (lib.optionals (!machineVars.headless) [
haskellPackages.xmobar
]);
etc = { etc = {
# TODO: move this out of etc, and reference it directly in sudo config. # TODO: move this out of etc, and reference it directly in sudo config.
sudoLecture = { sudoLecture = {
@ -127,15 +121,17 @@ in {
shellAliases.fixDisplay = let shellAliases.fixDisplay = let
inherit (config.machineVars) screens headless fixDisplayCommand; inherit (config.machineVars) screens headless fixDisplayCommand;
screenToArgs = screen: with screen; screenToArgs = screen: with screen;
"--output ${name} --mode ${resolution}" "--output ${name} --mode ${resolution}"
+ (lib.optionalString (frequency != null) " --rate ${frequency}"); + (lib.optionalString (frequency != null) " --rate ${frequency}");
screenArgs = lib.concatStringsSep " " (lib.mapAttrsToList screenToArgs screens); screenArgs = lib.concatStringsSep " " (lib.mapAttrsToList screenToArgs screens);
in lib.mkIf (!headless) in lib.mkIf (!headless)
(lib.mkMerge [ (if screenArgs == null
"xrandr ${screenArgs}" then "xrandr ${screenArgs}"
(lib.mkIf (fixDisplayCommand != null) fixDisplayCommand) else (lib.mkIf (fixDisplayCommand != null) fixDisplayCommand));
]);
}; };
fonts = { fonts = {

View File

@ -21,10 +21,12 @@
default = main; default = main;
}; };
screens = { fixDisplayCommand = "xrandr --output DP-4 --mode 1920x1080 --pos 0x0 -r 144 --output DVI-D-1 --primary --mode 1920x1080 --pos 1920x0 -r 60";
"DP-1" = {};
"HDMI-1" = {}; # screens = {
}; # "DP-1" = {};
# "HDMI-1" = {};
# };
}; };
systemd.targets = { systemd.targets = {
@ -55,12 +57,6 @@
firewall.enable = true; firewall.enable = true;
}; };
environment = {
shellAliases = {
fixscreen = "xrandr --output DP-4 --mode 1920x1080 --pos 0x0 -r 144 --output DVI-D-1 --primary --mode 1920x1080 --pos 1920x0 -r 60";
};
};
services = { services = {
openssh.enable = true; openssh.enable = true;
printing.enable = true; printing.enable = true;

View File

@ -7,40 +7,40 @@ in {
colorType = types.str; colorType = types.str;
mkColorOption = mkOption { mkColorOption = mkOption {
# name =
type = colorType; type = colorType;
}; };
colorSetType = types.submodule ({ name, ... }: { colorSetType = types.submodule ({ name, ... }: {
name = mkOption { options = {
type = types.str; name = mkOption {
default = name; type = types.str;
default = name;
};
foreground = mkColorOption;
background = mkColorOption;
black = mkColorOption;
red = mkColorOption;
green = mkColorOption;
yellow = mkColorOption;
blue = mkColorOption;
magenta = mkColorOption;
cyan = mkColorOption;
white = mkColorOption;
}; };
foreground = mkColorOption;
background = mkColorOption;
black = mkColorOption;
red = mkColorOption;
green = mkColorOption;
yellow = mkColorOption;
blue = mkColorOption;
magenta = mkColorOption;
cyan = mkColorOption;
white = mkColorOption;
}); });
in { in {
colorSets = mkOption { colorSets = mkOption {
type = types.attrsof colorSetType; type = types.attrsOf colorSetType;
}; };
defaultColorSet = mkOption { defaultColorSet = mkOption {
description = "the default color to use for applications"; description = "the default color to use for applications";
type = colorSetType; type = colorSetType;
default = cfg.color.colorSets.monokai;
}; };
}; };
config = { config.colors = rec {
colors.colorSets = { colorSets = {
monokai = rec { monokai = rec {
foreground = white; foreground = white;
background = black; background = black;
@ -67,6 +67,7 @@ in {
white = "#f7f3ee"; white = "#f7f3ee";
}; };
}; };
defaultColorSet = colorSets.monokai;
}; };
} }

View File

@ -49,7 +49,8 @@ t tools preinstalled.";
dataDrives = let dataDrives = let
driveType = driveType =
types.addCheck types.path (path: builtins.elem path (builtins.attrNames config.fileSystems)); types.path;
# types.addCheck types.path (path: builtins.elem path (builtins.attrNames config.fileSystems));
in { in {
drives = mkOption { drives = mkOption {
type = types.attrsOf driveType; type = types.attrsOf driveType;

View File

@ -1,5 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, ... }: let
{ inherit (config) machineVars;
in {
home.packages = with pkgs; [ home.packages = with pkgs; [
asciidoctor asciidoctor
beets beets
@ -130,7 +131,6 @@
mopidy mopidy
mopidy-mpd mopidy-mpd
mopidy-soundcloud mopidy-soundcloud
mopidy-spotify
mopidy-youtube mopidy-youtube
mpc_cli mpc_cli
nyxt nyxt

View File

@ -12,7 +12,7 @@ in {
]; ];
mpd_status_script = pkgs.writeShellScript "mpd-status" '' mpd_status_script = pkgs.writeShellScript "mpd-status" ''
MPD_STATUS=$(${pkgs.mpc}/bin/mpc 2>/dev/null | sed -n '2{p;q}' | cut -d ' ' -f1) MPD_STATUS=$(${pkgs.mpc-cli}/bin/mpc 2>/dev/null | sed -n '2{p;q}' | cut -d ' ' -f1)
case "$MPD_STATUS" in case "$MPD_STATUS" in
"[playing]") "[playing]")
echo "<fn=2><fc=#00ff00></fc></fn>" echo "<fn=2><fc=#00ff00></fc></fn>"