mirror of
https://github.com/ivabus/nixos
synced 2024-11-25 01:45:06 +03:00
Revisiting dotfiles installation
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
parent
607bd19125
commit
a23bb49688
6 changed files with 62 additions and 9 deletions
|
@ -55,9 +55,11 @@ in {
|
||||||
|
|
||||||
I "made" some shell in [shells/](./shells).
|
I "made" some shell in [shells/](./shells).
|
||||||
|
|
||||||
## Dotfiles (from `ivabus/dotfiles`)
|
## Dotfiles development
|
||||||
|
|
||||||
I install my dotfiles with prepared script
|
As I fully manage my dotfiles through home-manager and `fetchGit` they are readonly.
|
||||||
|
|
||||||
|
To install normal version of them disable `my.users.ivabus.dotfiles.enable` and run this command (which installs and links dotfiles)
|
||||||
|
|
||||||
```
|
```
|
||||||
curl https://iva.bz/nix | sh
|
curl https://iva.bz/nix | sh
|
||||||
|
@ -71,7 +73,6 @@ curl https://iva.bz/nix | sh
|
||||||
- [x] ивабус.рф (proxying not-Nix env)
|
- [x] ивабус.рф (proxying not-Nix env)
|
||||||
- Setup "secret" roles (I need them)
|
- Setup "secret" roles (I need them)
|
||||||
- Setup router (in progress with `periculo`, aughhhhhhhhh it seems like I need to crosscompile it for 30 days straight, so no fast progress)
|
- Setup router (in progress with `periculo`, aughhhhhhhhh it seems like I need to crosscompile it for 30 days straight, so no fast progress)
|
||||||
- Setup dotfiles properly with home-manager
|
|
||||||
|
|
||||||
## Copyright
|
## Copyright
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./base.nix
|
./base.nix
|
||||||
# ./dotfiles.nix unfinished yet
|
./dotfiles.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./laptop.nix
|
./laptop.nix
|
||||||
./locale.nix
|
./locale.nix
|
||||||
|
|
40
common/dotfiles.nix
Normal file
40
common/dotfiles.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
dotfiles = builtins.fetchGit {
|
||||||
|
url = "https://github.com/ivabus/dotfiles";
|
||||||
|
rev = "a13b0d425230661e1942484fcdfb5646abb4fddb";
|
||||||
|
};
|
||||||
|
theme = builtins.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme";
|
||||||
|
};
|
||||||
|
highlighting = builtins.fetchGit {
|
||||||
|
url = "https://github.com/zsh-users/zsh-syntax-highlighting.git";
|
||||||
|
# Just install the latest and don't care about updating
|
||||||
|
ref = "master";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# Option to disable dotfiles for development
|
||||||
|
options.my.users.ivabus.dotfiles.enable =
|
||||||
|
lib.mkEnableOption "Enable automatic dotfiles installation";
|
||||||
|
config.my.users.ivabus.dotfiles.enable = lib.mkDefault true;
|
||||||
|
config.home-manager = lib.mkIf
|
||||||
|
(config.my.users.ivabus.enable && config.my.users.ivabus.dotfiles.enable) ({
|
||||||
|
users.ivabus = {
|
||||||
|
home.file = {
|
||||||
|
".config" = {
|
||||||
|
source = "${dotfiles}/configs";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
".config/zsh/themes/ivabus.zsh-theme" = { source = theme; };
|
||||||
|
".config/zsh/plugins/zsh-syntax-highlighting/" = {
|
||||||
|
source = highlighting;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
".profile" = { source = "${dotfiles}/configs/.profile"; };
|
||||||
|
".zshrc" = { source = "${dotfiles}/configs/.zshrc"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
|
@ -5,8 +5,6 @@ in {
|
||||||
options = { my.git.enable = lib.mkEnableOption "Enable git configuration"; };
|
options = { my.git.enable = lib.mkEnableOption "Enable git configuration"; };
|
||||||
|
|
||||||
config = lib.mkIf (cfg.enable && config.my.users.ivabus.enable) {
|
config = lib.mkIf (cfg.enable && config.my.users.ivabus.enable) {
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.ivabus = {
|
home-manager.users.ivabus = {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -16,7 +14,6 @@ in {
|
||||||
signing.signByDefault = true;
|
signing.signByDefault = true;
|
||||||
package = pkgs.gitAndTools.gitFull;
|
package = pkgs.gitAndTools.gitFull;
|
||||||
};
|
};
|
||||||
home.stateVersion = "23.05";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ in rec {
|
||||||
hashedPassword = secrets.hashed-password;
|
hashedPassword = secrets.hashed-password;
|
||||||
};
|
};
|
||||||
programs.gnupg.agent.enable = true;
|
programs.gnupg.agent.enable = true;
|
||||||
|
home-manager.users.ivabus.home.stateVersion = "24.05";
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf (cfg.user.enable) {
|
(lib.mkIf (cfg.user.enable) {
|
||||||
|
@ -52,6 +53,7 @@ in rec {
|
||||||
openssh.authorizedKeys.keys = keys;
|
openssh.authorizedKeys.keys = keys;
|
||||||
password = "12345";
|
password = "12345";
|
||||||
};
|
};
|
||||||
|
home-manager.users.user.home.stateVersion = "24.05";
|
||||||
})
|
})
|
||||||
|
|
||||||
({
|
({
|
||||||
|
|
|
@ -7,7 +7,7 @@ in {
|
||||||
config = lib.mkIf (cfg.enable) {
|
config = lib.mkIf (cfg.enable) {
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(self: super: {
|
(self: super: {
|
||||||
mpv = super.wrapMpv (super.mpv.unwrapped.override {
|
mpv = (super.wrapMpv (super.mpv.unwrapped.override {
|
||||||
cddaSupport = true;
|
cddaSupport = true;
|
||||||
# No pulse today
|
# No pulse today
|
||||||
pulseSupport = false;
|
pulseSupport = false;
|
||||||
|
@ -18,11 +18,24 @@ in {
|
||||||
# Sway only
|
# Sway only
|
||||||
waylandSupport = config.my.roles.graphical.enable;
|
waylandSupport = config.my.roles.graphical.enable;
|
||||||
javascriptSupport = false;
|
javascriptSupport = false;
|
||||||
}) { };
|
}) { }).override { scripts = [ self.mpvScripts.mpris ]; };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
environment.systemPackages = with pkgs; [ vlc yt-dlp ffmpeg mpv ];
|
environment.systemPackages = with pkgs; [ vlc yt-dlp ffmpeg mpv ];
|
||||||
|
|
||||||
|
# Setting up only for ivabus user, because user user will use Firefox or anything else to play videos
|
||||||
|
home-manager.users.ivabus = lib.mkIf (config.my.users.ivabus.enable) {
|
||||||
|
programs.mpv = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
profile = "gpu-hq";
|
||||||
|
ytdl-format = "bestvideo+bestaudio";
|
||||||
|
sub-font = "JetBrains Mono";
|
||||||
|
sub-scale = "0.6";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Add support for CD/DVD/BD drives
|
# Add support for CD/DVD/BD drives
|
||||||
boot.initrd.availableKernelModules = [ "sr_mod" ];
|
boot.initrd.availableKernelModules = [ "sr_mod" ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue