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

View File

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

View File

@ -21,10 +21,12 @@
default = main;
};
screens = {
"DP-1" = {};
"HDMI-1" = {};
};
fixDisplayCommand = "xrandr --output DP-4 --mode 1920x1080 --pos 0x0 -r 144 --output DVI-D-1 --primary --mode 1920x1080 --pos 1920x0 -r 60";
# screens = {
# "DP-1" = {};
# "HDMI-1" = {};
# };
};
systemd.targets = {
@ -55,12 +57,6 @@
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 = {
openssh.enable = true;
printing.enable = true;

View File

@ -3,44 +3,44 @@ let
cfg = config.colors;
inherit (lib) types mkOption;
in {
options.colors = let
options.colors = let
colorType = types.str;
mkColorOption = mkOption {
# name =
type = colorType;
};
colorSetType = types.submodule ({ name, ... }: {
name = mkOption {
type = types.str;
default = name;
options = {
name = mkOption {
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 {
colorSets = mkOption {
type = types.attrsof colorSetType;
type = types.attrsOf colorSetType;
};
defaultColorSet = mkOption {
description = "the default color to use for applications";
type = colorSetType;
default = cfg.color.colorSets.monokai;
};
};
config = {
colors.colorSets = {
config.colors = rec {
colorSets = {
monokai = rec {
foreground = white;
background = black;
@ -67,6 +67,7 @@ in {
white = "#f7f3ee";
};
};
defaultColorSet = colorSets.monokai;
};
}

View File

@ -47,9 +47,10 @@ t tools preinstalled.";
default = null;
};
dataDrives = let
dataDrives = let
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 {
drives = mkOption {
type = types.attrsOf driveType;

View File

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

View File

@ -12,7 +12,7 @@ in {
];
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
"[playing]")
echo "<fn=2><fc=#00ff00></fc></fn>"