The great purge

This commit is contained in:
Alexander Bantyev 2020-05-20 18:41:56 +03:00
parent fad20b7c36
commit 4ae7aa9efa
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
16 changed files with 3 additions and 371 deletions

View File

@ -2,8 +2,6 @@
description =
"A collection of crap, hacks and copy-paste to make my localhosts boot";
edition = 201909;
inputs = {
nixpkgs-mopidy = {
type = "github";

View File

@ -1,12 +1,4 @@
{ pkgs, config, lib, inputs, ... }: {
programs.adb.enable = true;
environment.systemPackages = with pkgs;
lib.optionals config.deviceSpecific.goodMachine [
kded
ntfs3g
];
home-manager.users.balsoft.home.packages = with pkgs;
[
# Internet
@ -16,15 +8,7 @@
] ++ lib.optionals config.deviceSpecific.goodMachine ([
steamcmd
steam
kdenlive
frei0r
ffmpeg-full
ghc
haskellPackages.hoogle
clang
clang-tools
lldb
appimage-run
nixfmt
niv
stdman
@ -38,14 +22,6 @@
# Tools
zip
unrar
wireshark
micro
python3
qalculate-gtk
breeze-qt5
gnome3.adwaita-icon-theme
papirus-icon-theme
breeze-icons
ksysguard
wl-clipboard
grim
@ -53,39 +29,25 @@
abiword
gnumeric
gcalcli
google-drive-ocamlfuse
trojita
nix-zsh-completions
papirus-icon-theme
breeze-icons
kde-cli-tools
xdg_utils
nheko
gitAndTools.hub
git-crypt
nix-patch
waypipe
inputs.yt-utilities.defaultPackage.x86_64-linux
] ++ (with pkgs.kdeApplications; [
ark
dolphin
dolphin-plugins
eventviews
ffmpegthumbs
filelight
gwenview
kcachegrind
kcolorchooser
kdenlive
kolourpaint
kompare
krdc
krfb
ktnef
marble
okteta
okular
print-manager
ktorrent
]));
}

View File

@ -1,60 +0,0 @@
{ pkgs, config, lib, ... }:
with import ../../support.nix { inherit lib config; }; {
home-manager.users.balsoft.xsession.windowManager.i3.config.startup = [ { command = "${pkgs.trojita}/bin/trojita"; } ];
home-manager.users.balsoft.xdg.configFile."flaska.net/trojita.conf".text =
if !isNull config.secrets.mail then
genIni {
General = {
"app.updates.checkEnabled" = false;
"imap.auth.user" = "${config.secrets.mail.user}@${config.secrets.mail.host}";
"imap.auth.pass" = config.secrets.mail.password;
"imap.host" = config.secrets.mail.host;
"imap.archiveFolderName" = "Archive";
"imap.startmode" = "ONLINE";
"imap.method" = "SSL";
"imap.needsNetwork" = true;
"imap.numberRefreshInterval" = 300;
"imap.port" = 993;
"imap.proxy.system" = true;
"imap.starttls" = true;
"imapIdleRenewal" = 29;
"msa.method" = "SMTP";
"msa.smtp.auth" = true;
"msa.smtp.auth.reuseImapCredentials" = true;
"msa.smtp.burl" = false;
"msa.smtp.starttls" = true;
"msa.smtp.host" = config.secrets.mail.host;
"msa.smtp.port" = 25;
"offline.cache" = "days";
"offline.cache.numDays" = "30";
};
autoMarkRead = {
enabled = true;
seconds = 0;
};
composer = {
imapSentName = "Sent";
saveToImapEnabled = true;
};
gui = {
"mainWindow.layout" = "compact";
preferPlaintextRendering = true;
showSystray = false;
startMinimized = false;
};
identities = {
"1\\address" = "${config.secrets.mail.user}@${config.secrets.mail.host}";
"1\\organisation" = "serokell.io";
"1\\realName" = "Alexander Bantyev";
"1\\signature" = ''\x410\x43b\x435\x43a\x441\x430\x43d\x434\x440 \x411\x430\x43d\x442\x44c\x435\x432 /Alexander Bantyev/ aka balsoft\n\nNix DevOPS/SRE at serokell.io\n\n<balsoft@balsoft.ru>\n<alexander.bantyev@serokell.io>\n\nmatrix://@balsoft:balsoft.ru \n(https://matrix.to/#/@balsoft:balsoft.ru)\nhttps://t.me/balsoft\nhttps://github.com/balsoft\n'';
size = 1;
};
interoperability.revealVersions = true;
plugin = {
addressbook = "abookaddressbook";
password = "cleartextpassword";
};
}
else
"";
}

View File

@ -9,7 +9,6 @@ device:
./applications/okular.nix
./applications/yt-utilities.nix
./applications/firefox.nix
./workspace/autofs.nix
./workspace/sway
./workspace/i3blocks
./workspace/zsh.nix

View File

@ -16,8 +16,6 @@ with deviceSpecific; {
hardware.bluetooth.enable = true;
hardware.bluetooth.package = pkgs.bluezFull;
hardware.sane.enable = true;
services.throttled = {
enable = device == "T490s-Laptop";
extraConfig = ''
@ -99,15 +97,8 @@ with deviceSpecific; {
grub.efiInstallAsRemovable = true; # NVRAM is unreliable
});
consoleLogLevel = 3;
blacklistedKernelModules = lib.optionals (device == "Prestigio-Laptop") [
"axp288_charger"
"axp288_fuel_gauge"
"axp288_adc"
]; # Disable battery driver as it hangs this piece of shit
extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
extraModprobeConfig = "options ec_sys write_support=1";
kernel.sysctl."vm.swappiness" = 0;
kernelPackages = pkgs.linuxPackages;
kernel.sysctl."kernel/sysrq" = 1;
kernelParams = [
"quiet"
@ -118,8 +109,6 @@ with deviceSpecific; {
"rd.udev.log_priority=3"
"pti=off"
"spectre_v2=off"
] ++ lib.optionals (device == "Prestigio-Laptop") [
"intel_idle.max_cstate=1" # Otherwise it hangs
];
};
@ -131,12 +120,9 @@ with deviceSpecific; {
enable = true;
package = pkgs.pulseaudioFull;
support32Bit = true;
# systemWide = true;
extraConfig = ''
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
'';
extraModules = [ pkgs.pulseaudio-modules-bt ];
};
services.dbus.packages = [ pkgs.blueman ];
}

View File

@ -1,14 +0,0 @@
diff --git a/mpd/file.go b/mpd/file.go
index 340338e..b0d6634 100644
--- a/mpd/file.go
+++ b/mpd/file.go
@@ -67,6 +67,9 @@ func FileFromAttrs(attr mpd.Attrs) (s File, err error) {
// metadata field
durationF := 0.0
p.Float("duration", &durationF, true)
+ if durationF == 0.0 {
+ p.Float("Time", &durationF, true)
+ }
s.Duration = time.Duration(durationF * float64(time.Second))
err = p.Err

View File

@ -24,6 +24,5 @@ in {
hostName = config.device;
};
systemd.services.ModemManager.wantedBy =
lib.optional (config.device == "ThinkPad-Laptop") "network.target";
lib.optional (config.device == "T490s-Laptop") "network.target";
}

View File

@ -53,7 +53,6 @@ in {
nix = rec {
nixPath = lib.mkForce [
"nixpkgs=/etc/nixpkgs"
"nixos-config=/etc/nixos/configuration.nix"
];
binaryCaches = [ "https://cache.nixos.org" "https://cache.balsoft.ru" ];
@ -76,5 +75,6 @@ in {
extraOptions = ''
experimental-features = nix-command flakes
'';
requireSignedBinaryCaches = false;
};
}

View File

@ -99,6 +99,5 @@
balsoft ALL = (root) NOPASSWD: ${pkgs.light}/bin/light -U 5
'';
};
nix.requireSignedBinaryCaches = false;
home-manager.useUserPackages = true;
}

View File

@ -1,14 +0,0 @@
{ pkgs, config, lib, ... }: rec {
services.autofs.enable = true;
services.autofs.autoMaster = let
mapConf = pkgs.writeText "auto" (builtins.concatStringsSep "\n" (map (n:
"${n} -fstype=fuse,rw,nodev,noatime,allow_other,max_read=65536 :sshfs#balsoft@${n}:")
([ "balsoft.ru" ]
++ builtins.map (n: "${n}.lan") (builtins.attrNames config.devices))));
in ''
/auto file:${mapConf} uid=1000,gid=100,--timeout=30,--ghost
'';
environment.etc."autofs.conf".text = services.autofs.autoMaster;
environment.systemPackages = with pkgs; [ fuse sshfs ];
}

View File

@ -1,42 +0,0 @@
{ pkgs, config, lib, ... }: {
home-manager.users.balsoft.xsession.windowManager.i3.config.startup = [{
command = "${pkgs.autorandr}/bin/autorandr -c --force --default horizontal";
always = true;
}];
home-manager.users.balsoft.xsession.windowManager.i3.config.keybindings."${
config.home-manager.users.balsoft.xsession.windowManager.i3.config.modifier
}+p" = "exec ${pkgs.autorandr}/bin/autorandr -c --default horizontal";
home-manager.users.balsoft.programs.autorandr = {
enable = true;
profiles = {
dacha = {
fingerprint = {
HDMI1 =
"00ffffffffffff0010ac14a0505441322e0f010380221b782ec5c6a3574a9c23124f54a54b00714f8180010101010101010101010101302a009851002a4030701300520e1100001e000000fd003c4b1f500e000a202020202020000000fc0044454c4c204531373646500a20000000ff004d43303433354248324154500a013a02031b61230907078301000067030c002000802d43908402e2000f8c0ad08a20e02d10103e9600a05a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000029";
HDMI2 =
"00ffffffffffff0006b3cc24010101011a1a010380351e78ea0565a756529c270f5054afcf80714f8180818fb30081409500a9408bc0023a801871382d40582c45000f282100001e000000fd00304b1e5311000a202020202020000000fc00565a3234390a20202020202020000000ff0047364c4d52533034383636390a018902031df14a900403011412051f1013230907078301000065030c001000023a801871382d40582c45000f282100001e011d8018711c1620582c25000f282100009e011d007251d01e206e2855000f282100001e8c0ad08a20e02d10103e96000f282100001800000000000000000000000000000000000000000000000000004a";
eDP1 =
"00ffffffffffff000dae61130000000007180104a51d117802ce85a3574e9d2612505400000001010101010101010101010101010101363680a0703820402e1e240025a510000018242480a0703820402e1e240025a510000018000000fe00434d4e0a202020202020202020000000fe004e3133334853452d4541330a2000a1";
};
config = {
eDP1 = {
enable = true;
position = "0x1024";
mode = "1368x768";
};
HDMI1 = {
enable = true;
position = "0x0";
mode = "1280x1024";
};
HDMI2 = {
enable = true;
position = "1368x1024";
mode = "1920x1080";
primary = true;
};
};
};
};
};
}

View File

@ -1,14 +0,0 @@
{ pkgs, lib, config, ... }: {
home-manager.users.balsoft = {
programs.autorandr.hooks.preswitch.compton = "systemctl --user stop compton";
programs.autorandr.hooks.postswitch.compton = "systemctl --user start compton";
services.compton = {
enable = true;
backend = "glx";
noDNDShadow = false;
shadow = true;
shadowExclude = [ "!(I3_FLOATING_WINDOW@:c = 1)" ];
vSync = "opengl-swc";
};
};
}

View File

@ -1,50 +0,0 @@
{ pkgs, config, lib, ... }:
let thm = config.themes.colors;
in {
home-manager.users.balsoft = {
services.dunst = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
settings = {
global = {
geometry = "500x5-30+50";
transparency = 10;
frame_color = thm.blue;
font = "Roboto 13";
padding = 15;
horizontal_padding = 17;
word_wrap = true;
follow = "keyboard";
format = ''
%s %p %I
%b'';
markup = "full";
};
urgency_low = {
background = thm.bg;
foreground = thm.fg;
timeout = 5;
};
urgency_normal = {
background = thm.alt;
foreground = thm.fg;
timeout = 10;
};
urgency_critical = {
background = thm.fg;
foreground = thm.bg;
timeout = 15;
};
};
};
xsession.windowManager.i3.config.startup =
[{ command = "${pkgs.dunst}/bin/dunst"; }];
};
}

View File

@ -1,51 +0,0 @@
{ pkgs, config, ... }: {
home-manager.users.balsoft = {
accounts.email.accounts."${config.secrets.gmail.user}@gmail.com" = {
address = "${config.secrets.gmail.user}@gmail.com";
flavor = "gmail.com";
passwordCommand = "${pkgs.coreutils}/bin/echo ${config.secrets.gmail.password}";
realName = "Alexander Bantyev";
primary = true;
userName = config.secrets.gmail.user;
getmail = {
readAll = false;
enable = true;
mailboxes = [ "INBOX" "Junk" "Trash" ];
};
msmtp = { enable = true; };
imapnotify = {
enable = true;
boxes = [ "INBOX" ];
onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New mail in %s'";
};
notmuch.enable = true;
signature = {
showSignature = "append";
text = ''
Александр Бантьев /Alexander Bantyev/ aka balsoft
Nix, NixOS DevOPS/SRE at serokell.io
<balsoft75@gmail.com>
<alexander.bantyev@serokell.io>
https://matrix.to/#/@balsoft:balsoft.ru
https://t.me/balsoft
https://github.com/balsoft
'';
};
};
services = {
getmail = {
enable = true;
frequency = "*-*-* *:*:00,15,30,45";
};
imapnotify.enable = true;
};
programs = {
msmtp.enable = true;
notmuch.enable = true;
alot.enable = true;
};
};
}

View File

@ -1,28 +0,0 @@
{ pkgs, config, lib, ... }: {
services.synergy = if config.device == "AMD-Workstation" then {
server.enable = true;
server.configFile = pkgs.writeTextFile {
name = "synergy.conf";
text = ''
section: screens
AMD-Workstation
ASUS-Laptop:
HP-Laptop:
end
section: links
ASUS-Laptop:
right = AMD-Workstation
HP-Laptop:
left = AMD-Workstation
end
section: options
keystroke(super+alt+left) = switchInDirection(left)
keystroke(super+alt+right) = switchInDirection(right)
end
'';
};
} else {
client.enable = true;
client.serverAddress = "AMD-Workstation";
};
}

View File

@ -1,38 +0,0 @@
{ pkgs, lib, config, ... }:
let
cpu = config.deviceSpecific.cpu;
device = config.device;
isShared = config.deviceSpecific.isShared;
in {
services.xserver = {
enable = true;
enableTCP = true;
libinput = {
enable = true;
sendEventsMode = "disabled-on-external-mouse";
middleEmulation = false;
naturalScrolling = true;
};
videoDrivers = if cpu == "amd" then
["amdgpu"]
else if device == "Lenovo-Workstation" then
["radeon"]
else
["intel"];
displayManager.lightdm = {
enable = true;
greeter.enable = isShared;
autoLogin.enable = !isShared;
autoLogin.user = "balsoft";
};
desktopManager.plasma5.enable = true;
desktopManager.default = "none";
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
};
windowManager.default = "i3";
layout = "us,ru";
xkbOptions = "grp:caps_toggle,grp_led:caps";
};
}