This commit is contained in:
teutat3s 2022-01-19 01:13:15 +01:00
parent 952e8389c5
commit 082e33c1ed
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
38 changed files with 414 additions and 338 deletions

12
.envrc
View file

@ -1,2 +1,10 @@
watch_file shell/* flake.nix
use flake || use nix
# reload when these files change
watch_file flake.nix
watch_file shell.nix
{
# shell gc root dir
mkdir -p "$(direnv_layout_dir)"
eval "$(nix print-dev-env --profile $(direnv_layout_dir)/flake-profile)"
} || use nix

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1637793790,
"narHash": "sha256-oPXavjxETEWGXq8g7kQHyRLKUmLX2yPtGn+t3V0mrTY=",
"lastModified": 1640802000,
"narHash": "sha256-ZiI94Zv/IgW64fqKrtVaQqfUCkn9STvAjgfFmvtqcQ8=",
"owner": "ryantm",
"repo": "agenix",
"rev": "f85eea0e29fa9a8924571d0e398215e175f80d55",
"rev": "c5558c88b2941bf94886dfdede6926b1ba5f5629",
"type": "github"
},
"original": {
@ -23,10 +23,7 @@
"beautysh": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"bud",
"nixpkgs"
],
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix"
},
"locked": {
@ -90,11 +87,11 @@
]
},
"locked": {
"lastModified": 1634994402,
"narHash": "sha256-xmlCVVOYGpZoxgOqsDOVF0B0ASrnbNGVAEzID9qh2xo=",
"lastModified": 1640117230,
"narHash": "sha256-W7LXeJavyIzNfNaoEsK65sEaCGqE9MVWvK0xSzNR4ls=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "44da835ac40dab5fd231298b59d83487382d2fab",
"rev": "5851d9613edf8b2279746c7e5b9faac55ff17e8a",
"type": "github"
},
"original": {
@ -113,11 +110,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1637357482,
"narHash": "sha256-mMRxOlcQs3V9cZYsKGKWEjl+oqclhaH1SKT3QGeTQ0Q=",
"lastModified": 1639771334,
"narHash": "sha256-4hgZmsCPaL5QlcEijHmzaYYrEwHtUFqraCUrCqLGJOo=",
"owner": "input-output-hk",
"repo": "deploy-rs",
"rev": "5a6db26726ec8c7904aea5bcdf13589342386f9d",
"rev": "7267eab9139ca4476fd8ed49e2e8652bba4c037f",
"type": "github"
},
"original": {
@ -163,11 +160,11 @@
]
},
"locked": {
"lastModified": 1640031018,
"lastModified": 1640815524,
"narHash": "sha256-ZzyS803XuCl99XE4581m0Suni+q1Hz+Mpw6A9bs7VKM=",
"owner": "divnix",
"repo": "digga",
"rev": "3157889810e51a1ae03f82bf6bf6657ba8cf93c6",
"rev": "5c9417495d8ab8813377d7b990680258b9eb4cff",
"type": "github"
},
"original": {
@ -178,15 +175,15 @@
},
"fenix": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1637303083,
"narHash": "sha256-e2A5JBjxYNpjoGd53K0oVUUaS9ojwOT5rnThyPNS46M=",
"lastModified": 1639117493,
"narHash": "sha256-67H9uXUdauaqMfkcKzpgHR3GeOKPAwOs6G3C1VpT67o=",
"owner": "nix-community",
"repo": "fenix",
"rev": "8294ceadbbbe1a886640bfcc15f5a02a2b471955",
"rev": "94b5686cad2ed210da106b0b7e1e212dab43fbf2",
"type": "github"
},
"original": {
@ -307,11 +304,26 @@
},
"flake-utils_5": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
@ -327,11 +339,11 @@
]
},
"locked": {
"lastModified": 1637917557,
"narHash": "sha256-3u5bLyGn5NUG3RJA7/v1Bqa/QCFGqp/01Bh/4REf9m4=",
"lastModified": 1639871969,
"narHash": "sha256-6feWUnMygRzA9tzkrfAzpA5/NBYg75bkFxnqb1DtD7E=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4daff26495ca9ac67476cba8cf15c3e36d91ab18",
"rev": "697cc8c68ed6a606296efbbe9614c32537078756",
"type": "github"
},
"original": {
@ -359,11 +371,11 @@
},
"latest_2": {
"locked": {
"lastModified": 1638198142,
"narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=",
"lastModified": 1641887635,
"narHash": "sha256-kDGpufwzVaiGe5e1sBUBPo9f1YN+nYHJlYqCaVpZTQQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a308775674e178495767df90c419425474582a1",
"rev": "b2737d4980a17cc2b7d600d7d0b32fd7333aca88",
"type": "github"
},
"original": {
@ -380,11 +392,11 @@
]
},
"locked": {
"lastModified": 1638203339,
"narHash": "sha256-Sz3iCvbWrVWOD/XfYQeRJgP/7MVYL3/VKsNXvDeWBFc=",
"lastModified": 1639947939,
"narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=",
"owner": "nmattia",
"repo": "naersk",
"rev": "c3e56b8a4ffb6d906cdfcfee034581f9a8ece571",
"rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653",
"type": "github"
},
"original": {
@ -393,6 +405,25 @@
"type": "github"
}
},
"nix-dram": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1639413393,
"narHash": "sha256-OcmY7yw6gu+fb3J8UT9Qmj1+eyP8HaOF133ojEx0aq8=",
"owner": "pub-solar",
"repo": "nix-dram",
"rev": "07881073fcaa0fb394dbf8ce9fd1483afc376d95",
"type": "github"
},
"original": {
"owner": "pub-solar",
"repo": "nix-dram",
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1640478849,
@ -408,32 +439,13 @@
"type": "github"
}
},
"nix-dram": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1628492639,
"narHash": "sha256-ffF/oEhLs/stAsXXobruKHyH9jnMC2rt/SM3ASrs2U8=",
"owner": "dramforever",
"repo": "nix-dram",
"rev": "fba426108ea6bdeb1e362bac9da06cbd33726f41",
"type": "github"
},
"original": {
"owner": "dramforever",
"repo": "nix-dram",
"type": "github"
}
},
"nixos": {
"locked": {
"lastModified": 1638231428,
"narHash": "sha256-Sm5loBKdeusSvIAC+LtzRT6I7tAcqZdIPnHcxZt7NaE=",
"lastModified": 1642068274,
"narHash": "sha256-uncr2I2z6Y2ghTdm0VDzTPjPtBsaGpsb17HgL/fGDdg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "393c5357a0071d51668bcdc69dfc25ddacbd5840",
"rev": "00d17d8ddc4c12bae0cd750eb2bb51ee813a5301",
"type": "github"
},
"original": {
@ -446,7 +458,7 @@
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1637655461,
@ -464,11 +476,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1638182287,
"narHash": "sha256-vBzf+hbTJz2ZdXV/DWirl6wOO7tjdqzTIU+0FANt65U=",
"lastModified": 1640686209,
"narHash": "sha256-6glXUlKRDhEhNuYx6r3fXU6KH2/Vq9mJZjB9oUpwrmc=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "6b3f79de09c3de7c91ab51e55e87879f61b6faec",
"rev": "46df95ca81e7e4cf3458cdb4b7d1714b5fce9da5",
"type": "github"
},
"original": {
@ -479,11 +491,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1640831728,
"narHash": "sha256-KK5SKqqfAt+ev3bHLrVXJ6i4zx9YQW6k19oUInY8T2M=",
"lastModified": 1640861606,
"narHash": "sha256-AQ+84X0wbu8TqijaVcfAgldnV8AIFkbzXlyILuqub8o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5d90841dd0179430db010dfc2c58b2a7de4371be",
"rev": "c1792db42df222b0ec570bd774488f48aa0c91b1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1640897803,
"narHash": "sha256-FfBWDDz0/pgb+qtf6RGIkrsA1SW8lv77eUpm5xijTQQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0e57783d3a9ff01d3ace41d9f75d84b865285746",
"type": "github"
},
"original": {
@ -492,13 +520,13 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1636976544,
"narHash": "sha256-9ZmdyoRz4Qu8bP5BKR1T10YbzcB9nvCeQjOEw2cRKR0=",
"lastModified": 1638986258,
"narHash": "sha256-OceRdctKZRSgqQxVRvvNB0MaEnFMzQqjUffecoDE9eI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "931ab058daa7e4cd539533963f95e2bb0dbd41e6",
"rev": "581d2d6c9cd5c289002203581d8aa0861963a933",
"type": "github"
},
"original": {
@ -508,7 +536,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1640418986,
"narHash": "sha256-a8GGtxn2iL3WAkY5H+4E0s3Q7XJt6bTOvos9qqxT5OQ=",
@ -524,14 +552,29 @@
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1639399671,
"narHash": "sha256-KT+YqqPZsdzKNE4T8okeH8lV+a0vtFxD4w+P2CEZC40=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c95b2e99529891b1d52e065c34dd50c136151bcb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1638231901,
"narHash": "sha256-XzuvFTmsXULdWynQWzgaPHikepNhjEpK4o5WXfmRqek=",
"owner": "nix-community",
"repo": "NUR",
"rev": "4e68fb3d8f48e91196deb13f44bcfb421da25afb",
"type": "github"
"lastModified": 1626378135,
"narHash": "sha256-koC6DBYmLCrgXA+AMHVaODf1uHYPmvcFygHfy3eg6vI=",
"path": "/nix/store/6mfkswqi67m35qwv0vh7kpk8rypbl2rq-source",
"rev": "00c2ec8f0bbdf0cfb2135bde55fbae5d6b64aa6d",
"type": "path"
},
"original": {
"id": "nur",
@ -541,17 +584,17 @@
"nvfetcher": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_5",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1634524567,
"narHash": "sha256-v9ZTZj1WNQaaVfs1P1mUPuh518mmwpqszj1EjdeGUmc=",
"lastModified": 1640033174,
"narHash": "sha256-b8w7NgobOYLlFV9j+XGbF+51LpOll0QeatxEGRv7uhg=",
"owner": "berberman",
"repo": "nvfetcher",
"rev": "807513f4bbd0e3b5863f4c3b91f8ac846ed6da9b",
"rev": "8bbf1921a36343f9a78c68e2bbc9798ab8f3b768",
"type": "github"
},
"original": {
@ -563,7 +606,7 @@
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1625240517,
@ -590,10 +633,6 @@
"latest": "latest_2",
"naersk": "naersk",
"nix-dram": "nix-dram",
"nixlib": [
"digga",
"nixlib"
],
"nixos": "nixos",
"nixos-hardware": "nixos-hardware",
"nur": "nur",
@ -603,11 +642,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1637268320,
"narHash": "sha256-lxB1r+7cmZisiGLx0tZ2LaC6X/EcQTbRIWZfnLIIgs4=",
"lastModified": 1639071661,
"narHash": "sha256-4YySLORuK0qGGIEJj78S7CZ4jy4GIHJ5ks17k5AWblo=",
"owner": "rust-analyzer",
"repo": "rust-analyzer",
"rev": "f0da9406bcbde1bc727242b481d8de825e84f59a",
"rev": "2534b7db1a093543d5bd759b3a1ca9e34418fa31",
"type": "github"
},
"original": {

View file

@ -41,7 +41,7 @@
nixos-hardware.url = "github:nixos/nixos-hardware";
# PubSolarOS additions
nix-dram.url = "github:dramforever/nix-dram";
nix-dram.url = "github:pub-solar/nix-dram";
};
outputs =
@ -108,6 +108,9 @@
hosts = {
/* set host specific properties here */
NixOS = { };
fae = {
system = "aarch64-linux";
};
};
importables = rec {
profiles = digga.lib.rakeLeaves ./profiles // {
@ -144,7 +147,15 @@
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations {
fae = {
profilesOrder = [ "system" "direnv" ];
profiles.direnv = {
user = "nixos";
path = deploy.lib.x86_64-linux.activate.home-manager self.homeConfigurationsPortable.x86_64-linux.nixos;
};
};
};
defaultTemplate = self.templates.bud;
templates.bud.path = ./.;

View file

@ -1,14 +0,0 @@
assign [app_id="firefox"] $ws2
# seahorse
for_window [title="seahorse"] floating enabled
# NetworkManager
for_window [title="Network Connections"] floating enabled
# thunderbird
for_window [title="New Task:*"] floating enabled
for_window [title="Edit Task:*"] floating enabled
for_window [title="New Event:*"] floating enabled
for_window [title="Edit Event:*"] floating enabled

View file

@ -1,6 +0,0 @@
# Autostart applications
#
# Example:
# exec swayidle
#exec qMasterPassword

View file

@ -1,5 +0,0 @@
# switch keyboard input language
bindsym $mod+tab exec swaymsg input "1:1:AT_Translated_Set_2_keyboard" xkb_switch_layout next
bindsym $mod+Shift+F2 exec chromium --enable-features=UseOzonePlatform --ozone-platform=wayland

View file

@ -1,35 +0,0 @@
### Input configuration
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
input "type:keyboard" {
xkb_layout us,de
xkb_model pc105
xkb_options altwin:swap_alt_win
}
input "type:touchpad" {
tap enabled
natural_scroll enabled
}
# Touchpad controls
#bindsym XF86TouchpadToggle exec $HOME/Workspace/ben/toggletouchpad.sh # toggle touchpad
# Screen brightness controls
bindsym XF86MonBrightnessUp exec "brightnessctl -d intel_backlight set +10%; notify-send $(brightnessctl -d intel_backlight i | awk '/Current/ {print $4}')"
bindsym XF86MonBrightnessDown exec "brightnessctl -d intel_backlight set 10%-; notify-send $(brightnessctl -d intel_backlight i | awk '/Current/ { print $4}')"
# Keyboard backlight brightness controls
bindsym XF86KbdBrightnessDown exec "brightnessctl -d smc::kbd_backlight set 10%-; notify-send $(brightnessctl -d smc::kbd_backlight i | awk '/Current/ { print $4}')"
bindsym XF86KbdBrightnessUp exec "brightnessctl -d smc::kbd_backlight set +10%; notify-send $(brightnessctl -d smc::kbd_backlight i | awk '/Current/ { print $4}')"
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%; exec pactl set-sink-mute @DEFAULT_SINK@ 0 && notify-send 'Vol. up' #increase sound volume
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%; exec pactl set-sink-mute @DEFAULT_SINK@ 0 && notify-send 'Vol. down' #decrease sound volume
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && notify-send 'Mute sound' # mute sound
# Media player controls
bindsym XF86AudioPlay exec "playerctl play-pause; notify-send 'Play/Pause'"
bindsym XF86AudioNext exec "playerctl next; notify-send 'Next'"
bindsym XF86AudioPrev exec "playerctl previous; notify-send 'Prev.'"

View file

@ -1,41 +0,0 @@
### Output configuration
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
set $main_screen eDP-1
set $displayport DP-1
set $hmdi HDMI-A-1
output $main_screen
output $displayport scale 2
output $hdmi scale 1
output $main_screen pos 0 1080
output $displayport pos 0 0
output $hdmi pos 1920 0
#bindswitch lid:on output $main_screen disable
#bindswitch lid:off output $main_screen enable
bindsym $mod+Shift+x output $main_screen toggle
# TODO when using more monitors
## Manual management of external displays
# Set the shortcuts and what they do
#set $mode_display HDMI (i) top, (j) left, (k) bottom, (l) right, (o) off
#mode "$mode_display" {
# bindsym i output HDMI-A-1 enable; output HDMI-A-1 pos 0 0 bg ~/Pictures/wallpapers/active.png fill; output eDP-1 pos 0 1080, mode "default"
# bindsym j output HDMI-A-1 enable; output HDMI-A-1 pos 0 0 bg ~/Pictures/wallpapers/active.png fill; output eDP-1 pos 1920 0, mode "default"
# bindsym k output HDMI-A-1 enable; output HDMI-A-1 pos 0 900 bg ~/Pictures/wallpapers/active.png fill; output eDP-1 pos 0 0, mode "default"
# bindsym l output HDMI-A-1 enable; output HDMI-A-1 pos 1440 0 bg ~/Pictures/wallpapers/active.png fill; output eDP-1 pos 0 0, mode "default"
# bindsym o output HDMI-A-1 disable, mode "default"
#
# # back to normal: Enter or Escape
# bindsym Return mode "default"
# bindsym Escape mode "default"
#}
## Declare here the shortcut to bring the display selection menu
#bindsym $mod+x mode "$mode_display"

View file

@ -1,40 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in
{
imports = [
./hardware-configuration.nix
];
config = {
pub-solar.x-os.keyfile = "/etc/nixos/hosts/con/secrets/keyfile.bin";
pub-solar.nextcloud.enable = mkForce false;
home-manager = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.sessionVariables = {
DOCKER_BUILDKIT = "1";
};
# Custom device sway configs
xdg.configFile = mkIf psCfg.sway.enable {
"sway/config.d/10-applications.conf".source = ./.config/sway/config.d/applications.conf;
"sway/config.d/autostart.conf".source = ./.config/sway/config.d/autostart.conf;
"sway/config.d/10-custom-keybindings.conf".source = ./.config/sway/config.d/custom-keybindings.conf;
"sway/config.d/input-defaults.conf".source = ./.config/sway/config.d/input-defaults.conf;
"sway/config.d/screens.conf".source = ./.config/sway/config.d/screens.conf;
};
};
networking.hosts = {
"127.0.0.1" = [
"virtrex.test"
"api.virtrex.test"
"expo.test"
"proxy.test"
"dachfensterkonfigurator.test"
"handwerker.velux.test"
];
};
};
}

View file

@ -1,6 +0,0 @@
{ suites, ... }:
{
imports = [
./con.nix
] ++ suites.con;
}

View file

@ -1,34 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/382ae29a-ed0d-4e18-99db-6efb6afaae64";
fsType = "ext4";
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/fb2f9ace-ce72-4b0d-b8b5-a8792d374f3c";
fileSystems."/boot/efi" =
{
device = "/dev/disk/by-uuid/6BD6-50D2";
fsType = "vfat";
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}

View file

@ -18,11 +18,15 @@ in
pub-solar.virtualisation.enable = true;
# fix backlight for keyboard and brightness, adjust function key binding
# fix backlight for keyboard and brightness, adjust function key binding,
# intel_pstate for cpu schedutil, resume offset for swapfile, disable amdgpu driver
boot.kernelParams = [ "acpi_backlight=video" "hid_apple.fnmode=2" "intel_pstate=passive" "resume_offset=47366144" ];
boot.loader.efi.canTouchEfiVariables = true;
boot.resumeDevice = "/dev/mapper/cryptroot";
boot.kernelPackages = pkgs.linuxPackages_5_15;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
systemd.sleep.extraConfig = ''
HibernateMode=shutdown
'';
@ -43,8 +47,8 @@ in
# https://ubuntuforums.org/showthread.php?t=2409856
services.cron.systemCronJobs = [
"@reboot root ${pkgs.util-linux}/bin/rfkill block bluetooth"
"@reboot root ${pkgs.coreutils}/bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
"@reboot root ${pkgs.coreutils}/bin/echo 510 > /sys/class/backlight/gmux_backlight/brightness"
"@reboot root ${pkgs.coreutils}/bin/sleep 10; ${pkgs.coreutils}/bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
"@reboot root ${pkgs.coreutils}/bin/sleep 11; ${pkgs.coreutils}/bin/echo 510 > /sys/class/backlight/gmux_backlight/brightness"
];
# Increase console font size for HiDPI display
@ -116,7 +120,6 @@ in
hardware.firmware = with pkgs; [ wireless-regdb ];
boot.extraModprobeConfig = ''
options cfg80211 ieee80211_regdom="DE"
blacklist amdgpu
'';
# This value determines the NixOS release from which the default

View file

@ -30,13 +30,11 @@
forward-addr = [
"5.1.66.255@853#dot.ffmuc.net"
"185.150.99.255@853#dot.ffmuc.net"
"145.100.185.18@853#dnsovertls3.sinodun.com"
"89.233.43.71@853#unicast.censurfridns.dk"
"94.130.110.185@853#ns1.dnsprivacy.at"
"2001:678:e68:f000::@853#dot.ffmuc.net"
"2001:678:ed0:f000::@853#dot.ffmuc.net"
"2001:610:1:40ba:145:100:185:18@853#dnsovertls3.sinodun.com"
"2a01:3a0:53:53::0@853#unicast.censurfridns.dk"
"2a01:4f8:c0c:3c03::2@853#ns1.dnsprivacy.at"
"2a01:4f8:c0c:3bfc::2@853#ns2.dnsprivacy.at"

59
hosts/fae.nix Normal file
View file

@ -0,0 +1,59 @@
{ config, lib, pkgs, profiles, ... }:
{
imports = [
# profiles.networking
#profiles.core
"${fetchTarball {
url = "https://github.com/NixOS/nixos-hardware/archive/8f1bf828d8606fe38a02df312cf14546ae200a72.tar.gz";
sha256 = "11milap153g3f63fcrcv4777vd64f7wlfkk9p3kpxi6dqd2sxvh4";
}
}/raspberry-pi/4"
profiles.users.root # make sure to configure ssh keys
profiles.users.nixos
];
config = {
pub-solar.x-os.iso-options.enable = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
networking = {
hostName = "fae";
};
environment.systemPackages = with pkgs; [ vim ];
services.openssh.enable = true;
#users = {
# mutableUsers = false;
# users."${user}" = {
# isNormalUser = true;
# password = password;
# extraGroups = [ "wheel" ];
# };
#};
security.sudo.extraConfig = lib.mkAfter ''
%wheel ALL=(ALL) NOPASSWD:ALL
'';
# Enable GPU acceleration
hardware.raspberry-pi."4".fkms-3d.enable = true;
#services.xserver = {
# enable = true;
# displayManager.lightdm.enable = true;
# desktopManager.xfce.enable = true;
#};
hardware.pulseaudio.enable = true;
};
}

View file

@ -74,6 +74,6 @@ in
services.blueman.enable = true;
# Enable audio server & client
services.mopidy = import ./mopidy.nix pkgs;
#services.mopidy = import ./mopidy.nix pkgs;
};
}

View file

@ -92,6 +92,7 @@ in
gnome3.adwaita-icon-theme
gnome.eog
gnome3.nautilus
gnome.yelp
wine

View file

@ -12,10 +12,9 @@ in
config = mkIf cfg.enable {
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.packages = [
#mySignalDesktop
signal-desktop
tdesktop
element-desktop-wayland
element-desktop-search-fixed
irssi
];
};

View file

@ -32,7 +32,17 @@ in
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
wlr = {
enable = true;
settings = {
screencast = {
max_fps = 30;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
};
};
};
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
gtkUsePortal = true;
};

View file

@ -18,7 +18,6 @@ in
environment.shells = with pkgs; [
zsh
];
environment.systemPackages = with pkgs; [
screen
];

View file

@ -74,9 +74,7 @@ in
nodePackages.typescript-language-server
nodePackages.vim-language-server
nodePackages.vue-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.vscode-html-languageserver-bin
nodePackages.vscode-json-languageserver-bin
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server
python39Packages.python-lsp-server
python3Full
@ -131,6 +129,7 @@ in
vim-go
vim-javascript
vim-json
SchemaStore-nvim
vim-markdown
vim-nix
vim-ruby

View file

@ -33,24 +33,26 @@ lua <<EOF
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
buf_set_keymap('n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '<leader>dp', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', '<leader>dn', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
-- Add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- vscode HTML lsp needs this https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html
capabilities.textDocument.completion.completionItem.snippetSupport = true
for lsp_key, lsp_settings in pairs({
'bashls', ------------------------------- Bash
@ -76,10 +78,14 @@ lua <<EOF
}
},
['jsonls'] = { -------------------------- JSON
['cmd'] = {"json-languageserver", "--stdio"}
['settings'] = {
['json'] = {
['schemas' ] = require('schemastore').json.schemas()
}
}
},
'phpactor', ----------------------------- PHP
'pylsp', --------------------------------- Python
'pylsp', -------------------------------- Python
'rnix', --------------------------------- Nix
'solargraph', --------------------------- Ruby
'rust_analyzer', ------------------------ Rust
@ -90,7 +96,6 @@ lua <<EOF
['filetypes'] = { "terraform", "hcl", "tf" }
},
'tsserver', ----------------------------- Typescript / JavaScript
'angularls', ---------------------------- Angular
'vuels', -------------------------------- Vue
'svelte', ------------------------------- Svelte
['yamlls'] = { -------------------------- YAML
@ -101,6 +106,7 @@ lua <<EOF
['https://json.schemastore.org/github-action'] = '.github/action.{yml,yaml}',
['https://json.schemastore.org/ansible-stable-2.9'] = 'roles/tasks/*.{yml,yaml}',
['https://json.schemastore.org/drone'] = '*.drone.{yml,yaml}',
['https://json.schemastore.org/swagger-2.0'] = 'swagger.{yml,yaml}',
}
}
}
@ -116,7 +122,7 @@ lua <<EOF
capabilities = capabilities,
}
else -- Use the LSP's configuration.
local on_attach_setting = lsp_settings.on_attach
local on_attach_setting = on_attach
lsp_settings.on_attach = function()
if on_attach_setting then on_attach_setting() end

View file

@ -5,8 +5,10 @@ autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
let g:gutentags_file_list_command = 'git ls-files'
" Golang
" Go test shortcut
" Go test, Def, Decls shortcut
nmap <Leader>got :GoTest<CR>:botright copen<CR>
autocmd FileType go nmap gd :GoDef<CR>
autocmd FileType go nmap gD :GoDecls<CR>
" Go formatting
autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist

View file

@ -22,7 +22,6 @@ in
[ "$(tty)" = "/dev/tty1" ] && exec sway
'';
shellAliases = {
nano = "nvim";
vi = "nvim";
@ -71,13 +70,14 @@ in
bindkey '^R' fzf-history-widget
# ArrowUp/Down start searching history with current input
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
bindkey "^P" history-beginning-search-backward-end
bindkey "^N" history-beginning-search-forward-end
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
bindkey "^P" up-line-or-beginning-search
bindkey "^N" down-line-or-beginning-search
# MAKE CTRL+S WORK IN VIM
stty -ixon

View file

@ -19,7 +19,7 @@ in
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemu.ovmf.enable = true;
};
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
extraGroups = [ "libvirtd" ];

View file

@ -1,16 +1,22 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.pub-solar.x-os;
in
{
options.pub-solar.x-os.iso-options.enable = mkOption {
type = types.bool;
default = false;
description = "Feature flag for iso builds";
};
config = {
# Enable plymouth for better experience of booting
boot.plymouth.enable = true;
# Mount / luks device in initrd
# Allow fstrim to work on it.
boot.initrd = {
# The ! makes this enabled by default
boot.initrd = mkIf (!cfg.iso-options.enable) {
luks.devices."cryptroot" = {
allowDiscards = true;
};

View file

@ -0,0 +1,8 @@
final: prev: {
element-desktop-search-fixed = prev.element-desktop-wayland.overrideAttrs (oldAttrs: {
fixupPhase = ''
wrapProgram $out/bin/element-desktop \
--prefix LD_PRELOAD : ${prev.sqlcipher}/lib/libsqlcipher.so
'';
});
}

View file

@ -4,33 +4,28 @@ channels: final: prev: {
inherit (channels.latest)
cachix
deploy-rs
docker
docker-compose_2
dhall
discord
element-desktop
rage
nixpkgs-fmt
nomad
rage
qutebrowser
signal-desktop
starship
deploy-rs
thunderbird
firefox-wayland
element-desktop-wayland
neovim-unwrapped
nomad
tdesktop
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
obs-studio
obs-studio-plugins
looking-glass-client
;
# nix is set to 2.3 in 21.11
nix-direnv = prev.nix-direnv.override { nix = prev.nixUnstable; };
nix-direnv = prev.nix-direnv.override { nix_2_4 = true; };
haskellPackages = prev.haskellPackages.override
(old: {
@ -43,4 +38,7 @@ channels: final: prev: {
haskell-language-server;
});
});
# Example to override node package
# nodePackages = prev.nodePackages // { inherit (channels.latest.nodePackages) manta; };
}

View file

@ -3,6 +3,7 @@ with final; {
# keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage`
gpu-switch = writeShellScriptBin "gpu-switch" (import ./gpu-switch.nix final);
import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final);
lgcl = writeShellScriptBin "lgcl" (import ./lgcl.nix final);
mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final);

69
pkgs/gpu-switch.nix Normal file
View file

@ -0,0 +1,69 @@
self: with self; ''
# Copyright (c) 2014-2015 Bruno Bierbaumer, Andreas Heider
readonly sysfs_efi_vars='/sys/firmware/efi/efivars'
readonly efi_gpu='gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9'
usage(){
cat <<EOF
Usage:
$(basename $0) --integrated # Switch to the integrated GPU
$(basename $0) --dedicated # Switch to the dedicated GPU
$(basename $0) --help # Show this message
Switches between the integrated and dedicated graphics cards of a dual-GPU
MacBook Pro for the next reboot.
Arguments:
-i, --integrated
-d, --dedicated
-h, --help
Tested hardware:
MacBook Pro 5,2 (Early 2009, Non-Retina)
MacBook Pro 5,3 (Mid 2009, Non-Retina)
MacBook Pro 8,2 (Late 2011, Non-Retina)
MacBook Pro 9,1 (Mid 2012, Non-Retina)
MacBook Pro 10,1 (Mid 2012, Retina)
MacBook Pro 11,3 (Late 2013, Retina)
MacBook Pro 11,5 (Mid 2015, Retina)
EOF
}
switch_gpu(){
if ! [ -d /sys/firmware/efi ]; then
printf "Fatal: $(basename $0) has to be run in EFI mode.\n" 1>&2
exit 1
fi
if ! mount | grep -q $sysfs_efi_vars; then
if ! mount -t efivarfs none $sysfs_efi_vars; then
printf "Fatal: Couldn't mount ''${sysfs_efi_vars}.\n" 1>&2
exit 1
fi
fi
chattr -i "''${sysfs_efi_vars}/''${efi_gpu}" 2> /dev/null
printf "\x07\x00\x00\x00\x''${1}\x00\x00\x00" > "''${sysfs_efi_vars}/''${efi_gpu}"
}
if [ $# -ne 1 ]; then
usage 1>&2
exit 1
fi
case "$1" in
-i|--integrated)
switch_gpu 1
;;
-d|--dedicated)
switch_gpu 0
;;
-h|--help)
usage
;;
*)
usage 1>&2
exit 1
;;
esac
''

View file

@ -1,20 +1,20 @@
self: with self;
let
websocket-client = python38.pkgs.buildPythonPackage rec {
websocket-client = python39.pkgs.buildPythonPackage rec {
pname = "websocket-client";
version = "1.0.0";
version = "1.2.1";
doCheck = false;
src = python38.pkgs.fetchPypi {
src = python39.pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-UFGzii9MJ/vXygd+uyPsaWWmJt7VqVY382vhs1tsT4E=";
sha256 = "sha256-jftxXYqZL1cS//jIQ62ulOIrIqmbLF5rDsShqYHMTg0=";
};
};
in
python38.pkgs.buildPythonPackage rec {
python39.pkgs.buildPythonPackage rec {
pname = "Mopidy-Jellyfin";
version = "1.0.2";
doCheck = false;
propagatedBuildInputs = with python38.pkgs; [
propagatedBuildInputs = with python39.pkgs; [
unidecode
websocket-client
requests
@ -22,7 +22,7 @@ python38.pkgs.buildPythonPackage rec {
pykka
mopidy
];
src = python38.pkgs.fetchPypi {
src = python39.pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-5XimIIQSpvNyQbSOFtSTkA0jhA0V68BbyQEQNnov+0g=";
};

View file

@ -4,7 +4,7 @@
"height": 26, // Waybar height
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["mpd"],
//"modules-center": ["mpd"],
"modules-right": ["sway/language", "pulseaudio", "network", "idle_inhibitor", "battery", "clock", "tray"],
"sway/workspaces": {
"disable-scroll": true

View file

@ -1,7 +1,7 @@
{ pkgs, lib, budUtils, ... }: {
bud.cmds = with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ];
writer = budUtils.writeBashWithPaths [ nixFlakes git coreutils ];
synopsis = "get [DEST]";
help = "Copy the desired template to DEST";
script = ./get.bash;

View file

@ -15,6 +15,9 @@ in
imports = [ "${extraModulesPath}/git/hooks.nix" ];
git = { inherit hooks; };
# override for our own welcome
devshell.name = pkgs.lib.mkForce "PubSolarOS";
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
# PATH is devshell's exorbitant privilige:
@ -31,7 +34,7 @@ in
'');
commands = with pkgs; [
(devos nixUnstable)
(devos nixFlakes)
(devos agenix)
{
category = "devos";

View file

@ -1,7 +1,13 @@
{ config, pkgs, ... }:
let
in
pkgs.lib.mkAfter ''[includeIf "gitdir:~/CodeRoom/greenbaum.cloud/"]
pkgs.lib.mkAfter ''[sendemail]
smtpserver = smtp.mailbox.org
smtpuser = jhonas@mailbox.org
smtpencryption = tls
smtpserverport = 587
[includeIf "gitdir:~/CodeRoom/greenbaum.cloud/"]
path = ~/.config/git/config_greenbaum.cloud
[includeIf "gitdir:~/CodeRoom/git.b12f.io/"]

View file

@ -0,0 +1,29 @@
{ config, pkgs, ... }:
let
in
''# Watson configuration
# showing defaults commented out
# not implemented yet as of 2.0.1
#[backend]
#url = https://api.crick.fr
#token = yourapitoken
[options]
#options.confirm_new_project = false
#options.confirm_new_tag = false
date_format = %d.%m.%Y
#log_current = false
#pager = true
#report_current = false
#reverse_log = true
stop_on_start = true
#stop_on_restart = false
time_format = %H:%M%z
#week_start = monday
#[default_tags]
#project-name = tag1 tag2
#python101 = teaching python
#voyager2 = nasa 'space mission'
''

View file

@ -15,17 +15,19 @@ in
{ key = "V"; mods = "Control|Super"; action = "Paste"; }
{ key = "C"; mods = "Control|Super"; action = "Copy"; }
];
services.kbfs.enable = false;
services.keybase.enable = false;
services.kbfs.enable = true;
services.keybase.enable = true;
services.yubikey-agent.enable = true;
home-manager = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
xdg.configFile."git/config".text = import ./.config/git/config.nix { inherit config; inherit pkgs; };
xdg.configFile."git/config_greenbaum.cloud".text = import ./.config/git/config_greenbaum.cloud.nix { inherit config; inherit pkgs; };
xdg.configFile."git/config_git.b12f.io".text = import ./.config/git/config_git.b12f.io.nix { inherit config; inherit pkgs; };
xdg.configFile."watson/config".text = import ./.config/watson/config.nix { inherit config; inherit pkgs; };
home.packages = with pkgs; [
AusweisApp2
consul
gpu-switch
ifmetric
ipmitool
keybase-gui
@ -67,7 +69,7 @@ in
};
programs.zsh = {
initExtra = import ./zshrc.nix pkgs;
initExtra = import ./zshrc.nix { inherit config; inherit pkgs; };
};
# xdg.configFile."wallpaper.jpg".source = ./assets/wallpaper.jpg;

View file

@ -7,6 +7,7 @@ in
home-manager = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.sessionVariables = {
DRONE_SERVER = "https://ci.b12f.io";
GOPATH = "/home/${psCfg.user.name}/CodeRoom/go";
};
};
}

View file

@ -1,4 +1,4 @@
pkgs:
{ config, pkgs, ... }:
''
bindkey "^[[1;3D" backward-word
bindkey "^[[1;3C" forward-word
@ -83,5 +83,5 @@ pkgs:
complete -o nospace -C ${pkgs.waypoint}/bin/waypoint waypoint
complete -C '${pkgs.awscli2}/bin/aws_completer' ${pkgs.awscli2}/bin/aws
source /run/secrets/environment-secrets
source ${config.age.secrets.environment-secrets.path}
''