Complete unstable configuration with home manager

This commit is contained in:
Filippo Berto 2022-04-15 17:16:06 +02:00
parent bbee9d7993
commit df1d6df54e
17 changed files with 412 additions and 312 deletions

View file

@ -3,8 +3,7 @@
, rice , rice
, roboto , roboto
, i3lock-color , i3lock-color
, update-background , writeScriptBin
, writeScript
, font ? { package = roboto; name = "Roboto"; } , font ? { package = roboto; name = "Roboto"; }
, palette ? rice.palette.palette {} , palette ? rice.palette.palette {}
, ... , ...
@ -12,7 +11,7 @@
let let
strPalette = rice.palette.toRGBAHex palette; strPalette = rice.palette.toRGBAHex palette;
in in
writeScript "lockscreen.sh" '' writeScriptBin "lockscreen" ''
#!/bin/sh #!/bin/sh
# Using font package ${font.package} # Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \ ${i3lock-color}/bin/i3lock-color \
@ -53,6 +52,5 @@ writeScript "lockscreen.sh" ''
--pass-media-keys \ --pass-media-keys \
--pass-screen-keys \ --pass-screen-keys \
--pass-volume-keys \ --pass-volume-keys \
--nofork && --nofork
${update-background} ''
''

View file

@ -5,14 +5,14 @@
, findutils , findutils
, gnugrep , gnugrep
, coreutils , coreutils
, writeScript , writeScriptBin
, backgrounds_directory ? "$HOME/Immagini/Sfondi"}: , backgrounds_directory ? "$HOME/Immagini/Sfondi"}:
let let
find = "${findutils}/bin/find"; find = "${findutils}/bin/find";
grep = "${gnugrep}/bin/grep"; grep = "${gnugrep}/bin/grep";
shuf = "${coreutils}/bin/shuf"; shuf = "${coreutils}/bin/shuf";
in in
writeScript "update-background.sh" '' writeScriptBin "update-background" ''
#!/bin/sh #!/bin/sh
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1` image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1`

View file

@ -1,15 +0,0 @@
values: {
enableCpp = false;
enableData = false;
enableGo = false;
enableHtml = false;
enableJava = false;
enableJavascript = false;
enableLatex = false;
enableNix = false;
enablePython = false;
enableRust = false;
enableShell = false;
enableSpelling = false;
enableOffice = true;
} // values

85
flake.lock generated
View file

@ -1,5 +1,20 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -21,6 +36,26 @@
"type": "github" "type": "github"
} }
}, },
"home-manager-unstable": {
"inputs": {
"nixpkgs": [
"unstable"
]
},
"locked": {
"lastModified": 1649887921,
"narHash": "sha256-h2LZzn5LLwIFvVFLCdR8+VWluEP3U1I5y+0mDZjFjAk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "92f58b6728e7c631a7ea0ed68cd21bb29a4876ff",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1649849514, "lastModified": 1649849514,
@ -54,12 +89,62 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-unstable": "home-manager-unstable",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay",
"tex2nix": "tex2nix",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
"rust-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1649903781,
"narHash": "sha256-m+3EZo0a4iS8IwHQhkM/riPuFpu76505xKqmN9j5O+E=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e45696bedc4a13a5970376b8fc09660fdd0e6f6c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"tex2nix": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1646670117,
"narHash": "sha256-fU6gLOP2xm6lTRKfMKeXAm7rEhYAVR4RcRFK1zh/QTM=",
"owner": "Mic92",
"repo": "tex2nix",
"rev": "74159694f0c27ffa3f9172c6d691635568fbece4",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "tex2nix",
"type": "github"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1649673231, "lastModified": 1649673231,

View file

@ -3,32 +3,81 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11"; nixpkgs.url = "github:NixOS/nixpkgs/release-21.11";
home-manager = {
url = "github:nix-community/home-manager/release-21.11";
inputs.nixpkgs.follows = "nixpkgs";
};
unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-21.11"; home-manager-unstable = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "unstable";
};
flake-utils.url = "github:numtide/flake-utils";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
# nixos-hardware.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
tex2nix = {
url = github:Mic92/tex2nix;
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
}; };
outputs = { self, nixpkgs, unstable, home-manager, nixos-hardware }: outputs =
{ self
, nixpkgs
, home-manager
, unstable
, home-manager-unstable
, flake-utils
, nixos-hardware
, rust-overlay
, tex2nix
}:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { overlays = [
inherit system; (import ./rice.nix)
config = { allowUnfree = true; }; (rust-overlay.overlay)
(final: prev: { inherit (tex2nix.packages.${system}) tex2nix; })
(final: prev: {
# cocktail-bar-cli = final.callPackage ./custom/cocktail-bar-cli { };
# update-background = final.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; };
lockscreen = final.callPackage ./custom/lockscreen {
palette = final.rice.colorPalette;
font = final.rice.font.normal;
};
})
];
nixpkgsSettings = {
inherit overlays system;
config = {
allowUnfree = true;
permittedInsecurePackages = [ "electron-9.4.4" ]; # authy dependency
};
}; };
unstablePkgs = import nixpkgs { pkgs = import nixpkgs nixpkgsSettings;
inherit system; unstablePkgs = import nixpkgs nixpkgsSettings;
config = { allowUnFree = true; };
};
lib = nixpkgs.lib;
in in
{ {
packages.x86_64-linux = pkgs;
nixosConfigurations = rec { nixosConfigurations = rec {
thor = lib.nixosSystem { thor = pkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
{ nixpkgs = nixpkgsSettings; }
./thor/hardware-configuration.nix ./thor/hardware-configuration.nix
nixos-hardware.nixosModules.common-cpu-amd nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-pc-ssd nixos-hardware.nixosModules.common-pc-ssd
@ -36,10 +85,12 @@
]; ];
}; };
odin = odin-intel; odin = odin-intel;
odin-intel = lib.nixosSystem { odin-intel = pkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
{ nixpkgs = nixpkgsSettings; }
./odin/hardware-configuration.nix ./odin/hardware-configuration.nix
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop
@ -53,6 +104,7 @@
inherit system; inherit system;
modules = [ modules = [
{ nixpkgs = nixpkgsSettings; }
./odin/hardware-configuration.nix ./odin/hardware-configuration.nix
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop
@ -66,6 +118,7 @@
inherit system; inherit system;
modules = [ modules = [
{ nixpkgs = nixpkgsSettings; }
./odin/hardware-configuration.nix ./odin/hardware-configuration.nix
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop
@ -73,6 +126,14 @@
./odin/base.nix ./odin/base.nix
./odin/odin-nvidia.nix ./odin/odin-nvidia.nix
./odin/pro_audio.nix ./odin/pro_audio.nix
home-manager-unstable.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# home-manager.nixpkgs.overlays = overlays;
home-manager.users.bertof = import ./odin.nix;
# home-manager.users.bertof.home.packages = [ unstable.hello ];
}
]; ];
}; };
}; };

View file

@ -1,4 +1,3 @@
{ pkgs, ...}: { pkgs, ...}:
{ { programs.java.enable = true;
programs.java.enable = pkgs.devEnvironment.enableJava ? false;
} }

View file

@ -18,33 +18,33 @@ let
# editorconfig-core-c # editorconfig-core-c
python3.pkgs.editorconfig python3.pkgs.editorconfig
] ++ ( ] ++ (
lib.optionals (pkgs.devEnvironment.enableCpp) [ [
clang-tools clang-tools
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableData) [ [
yaml-language-server yaml-language-server
nodePackages.vscode-langservers-extracted nodePackages.vscode-langservers-extracted
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableHtml) [ [
nodePackages.vscode-langservers-extracted nodePackages.vscode-langservers-extracted
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableJavascript) [ [
flow flow
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableLatex) [ [
texlab texlab
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableNix) [ [
rnix-lsp rnix-lsp
] ]
) ++ ( ) ++ (
with python3.pkgs; with python3.pkgs;
lib.optionals (pkgs.devEnvironment.enablePython) [ [
black black
# pyls-black # pyls-black
pyls-flake8 pyls-flake8
@ -53,7 +53,7 @@ let
python-lsp-server python-lsp-server
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableRust) [ [
cargo cargo
cargo-watch cargo-watch
clippy clippy
@ -62,11 +62,11 @@ let
rustfmt rustfmt
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableShell) [ [
nodePackages.bash-language-server nodePackages.bash-language-server
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableSpelling) [ [
aspell aspell
aspellDicts.en aspellDicts.en
aspellDicts.en-computers aspellDicts.en-computers
@ -74,26 +74,15 @@ let
aspellDicts.it aspellDicts.it
] ]
); );
plugins = with pkgs;
[
kakounePlugins.prelude-kak
kakounePlugins.kak-lsp
kakounePlugins.auto-pairs-kak
kakounePlugins.powerline-kak
kakounePlugins.connect-kak
];
in in
{ {
home.sessionVariables = { home.sessionVariables = {
EDITOR = "kak"; EDITOR = "kak";
VISUAL = "kak"; VISUAL = "kak";
}; };
programs.bash.shellAliases = { programs.bash.shellAliases = { k = "kak"; };
k = "kak"; programs.zsh.shellAliases = { k = "kak"; };
};
programs.zsh.shellAliases = {
k = "kak";
};
home.packages = packages; home.packages = packages;
programs.kakoune = { programs.kakoune = {
enable = true; enable = true;
@ -254,7 +243,7 @@ in
commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ];
} }
] ++ ( ] ++ (
lib.optionals (pkgs.devEnvironment.enableLatex) [ [
{ {
name = "BufSetOption"; name = "BufSetOption";
option = "filetype=latex"; option = "filetype=latex";
@ -262,7 +251,7 @@ in
} }
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enablePython) [ [
{ {
name = "BufSetOption"; name = "BufSetOption";
option = "filetype=python"; option = "filetype=python";
@ -270,7 +259,7 @@ in
} }
] ]
) ++ ( ) ++ (
lib.optionals (pkgs.devEnvironment.enableData) [ [
{ {
name = "BufSetOption"; name = "BufSetOption";
option = "filetype=(markdown|html|json|yaml|css|scss|less)"; option = "filetype=(markdown|html|json|yaml|css|scss|less)";
@ -301,173 +290,164 @@ in
"require-module connect-lf" "require-module connect-lf"
"require-module connect-rofi" "require-module connect-rofi"
]; ];
plugins = plugins; plugins = with pkgs.kakounePlugins; [
prelude-kak
kak-lsp
auto-pairs-kak
powerline-kak
connect-kak
];
}; };
xdg.configFile."kak/colors/nord.kak".text = with strPalette; xdg.configFile."kak/colors/nord.kak".text = with strPalette; ''
'' set-face global value rgb:${normal.magenta},default
set-face global value rgb:${normal.magenta},default set-face global type rgb:${bright.white},default
set-face global type rgb:${bright.white},default set-face global identifier rgb:${normal.cyan},default
set-face global identifier rgb:${normal.cyan},default set-face global string rgb:${normal.green},default
set-face global string rgb:${normal.green},default set-face global error rgb:${normal.red},default
set-face global error rgb:${normal.red},default set-face global keyword rgb:${normal.blue},default
set-face global keyword rgb:${normal.blue},default set-face global operator rgb:${normal.blue},default
set-face global operator rgb:${normal.blue},default set-face global attribute rgb:${bright.blue},default
set-face global attribute rgb:${bright.blue},default set-face global comment rgb:${bright.blue},default
set-face global comment rgb:${bright.blue},default set-face global meta rgb:${normal.yellow},default
set-face global meta rgb:${normal.yellow},default set-face global Default rgb:${normal.white},default
set-face global Default rgb:${normal.white},default set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} set-face global MenuBackground default,rgb:${normal.black}
set-face global MenuBackground default,rgb:${normal.black} set-face global MenuInfo default,rgb:${normal.black}
set-face global MenuInfo default,rgb:${normal.black} set-face global Information rgb:${dark.black},rgb:${normal.cyan}
set-face global Information rgb:${dark.black},rgb:${normal.cyan} set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
set-face global StatusLine rgb:${normal.white},rgb:${normal.black} set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} set-face global BufferPadding default,default
set-face global BufferPadding default,default '';
''; xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; builtins.concatStringsSep "\n"
xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; [
builtins.concatStringsSep "\n" ( ''
[ snippet_support = false
'' verbosity = 2
snippet_support = false [server]
verbosity = 2 timeout = 1800 # seconds = 30 minutes
[server] ''
timeout = 1800 # seconds = 30 minutes ''
'' [language.c_cpp]
] filetypes = ["c", "cpp"]
++ ( roots = ["compile_commands.json", ".clangd"]
lib.optional (pkgs.devEnvironment.enableCpp) '' command = "${clang-tools}/bin/clangd"
[language.c_cpp] offset_encoding = "utf-8"
filetypes = ["c", "cpp"] ''
roots = ["compile_commands.json", ".clangd"] ''
command = "${clang-tools}/bin/clangd" [language.json]
offset_encoding = "utf-8" filetypes = ["json"]
'' roots = ["package.json"]
) ++ ( command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server"
lib.optional (pkgs.devEnvironment.enableData) '' args = ["--stdio"]
[language.json] [language.yaml]
filetypes = ["json"] filetypes = ["yaml"]
roots = ["package.json"] roots = [".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server" command = "${yaml-language-server}/bin/yaml-language-server"
args = ["--stdio"] args = ["--stdio"]
[language.yaml] [language.yaml.settings]
filetypes = ["yaml"] # See https://github.com/redhat-developer/yaml-language-server#language-server-settings
roots = [".git"] # Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
command = "${yaml-language-server}/bin/yaml-language-server" yaml.format.enable = true
args = ["--stdio"] ''
[language.yaml.settings] ''
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings [language.go]
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts filetypes = ["go"]
yaml.format.enable = true roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
'' command = "gopls"
) ++ ( offset_encoding = "utf-8"
lib.optional (pkgs.devEnvironment.enableGo) '' settings_section = "gopls"
[language.go] [language.go.settings.gopls]
filetypes = ["go"] # See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] # "build.buildFlags" = []
command = "gopls" ''
offset_encoding = "utf-8" ''
settings_section = "gopls" [language.html]
[language.go.settings.gopls] filetypes = ["html"]
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md roots = ["package.json"]
# "build.buildFlags" = [] command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server"
'' args = ["--stdio"]
) [language.css]
++ ( filetypes = ["css"]
lib.optional (pkgs.devEnvironment.enableHtml) '' roots = ["package.json", ".git"]
[language.html] command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
filetypes = ["html"] args = ["--stdio"]
roots = ["package.json"] [language.less]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server" filetypes = ["less"]
args = ["--stdio"] roots = ["package.json", ".git"]
[language.css] command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
filetypes = ["css"] args = ["--stdio"]
roots = ["package.json", ".git"] [language.scss]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" filetypes = ["scss"]
args = ["--stdio"] roots = ["package.json", ".git"]
[language.less] command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
filetypes = ["less"] args = ["--stdio"]
roots = ["package.json", ".git"] ''
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" ''
args = ["--stdio"] [language.javascript]
[language.scss] filetypes = ["javascript"]
filetypes = ["scss"] roots = [".flowconfig"]
roots = ["package.json", ".git"] command = "${flow}/bin/flow"
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" args = ["lsp"]
args = ["--stdio"] ''
'' ''
) ++ ( [language.latex]
lib.optional (pkgs.devEnvironment.enableJavascript) '' filetypes = ["latex"]
[language.javascript] roots = [".git"]
filetypes = ["javascript"] command = "${texlab}/bin/texlab"
roots = [".flowconfig"] settings_section = "texlab"
command = "${flow}/bin/flow" [language.latex.settings.texlab]
args = ["lsp"] # See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
'' # bibtexFormatter = "${texlab}/bin/texlab"
) ++ ( ''
lib.optional (pkgs.devEnvironment.enableLatex) '' ''
[language.latex] [language.nix]
filetypes = ["latex"] filetypes = ["nix"]
roots = [".git"] roots = ["flake.nix", "shell.nix", ".git"]
command = "${texlab}/bin/texlab" command = "${rnix-lsp}/bin/rnix-lsp"
settings_section = "texlab" ''
[language.latex.settings.texlab] ''
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs [language.python]
# bibtexFormatter = "${texlab}/bin/texlab" filetypes = ["python"]
'' roots = ["requirements.txt", "setup.py", ".git", ".hg"]
) ++ ( command = "${python3.pkgs.python-lsp-server}/bin/pylsp"
lib.optional (pkgs.devEnvironment.enableNix) '' offset_encoding = "utf-8"
[language.nix] [language.python.settings]
filetypes = ["nix"] # See https://github.com/palantir/python-language-server#configuration
roots = ["flake.nix", "shell.nix", ".git"] # and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
command = "${rnix-lsp}/bin/rnix-lsp" # "pyls.configurationSources" = ["flake8"]
'' ''
) ++ ( ''
lib.optional (pkgs.devEnvironment.enablePython) '' [language.rust]
[language.python] filetypes = ["rust"]
filetypes = ["python"] roots = ["Cargo.toml"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"] command = "${rust-analyzer}/bin/rust-analyzer"
command = "${python3.pkgs.python-lsp-server}/bin/pylsp" settings_section = "rust-analyzer"
offset_encoding = "utf-8" [language.rust.settings.rust-analyzer]
[language.python.settings] hoverActions.enable = false # kak-lsp doesn't support this at the moment
# See https://github.com/palantir/python-language-server#configuration # cargo.features = []
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json # See https://rust-analyzer.github.io/manual.html#configuration
# "pyls.configurationSources" = ["flake8"] # If you get 'unresolved proc macro' warnings, you have two options
'' # 1. The safe choice is two disable the warning:
) ++ ( diagnostics.disabled = ["unresolved-proc-macro"]
lib.optional (pkgs.devEnvironment.enableRust) '' # 2. Or you can opt-in for proc macro support
[language.rust] procMacro.enable = true
filetypes = ["rust"] cargo.loadOutDirsFromCheck = true
roots = ["Cargo.toml"] # See https://github.com/rust-analyzer/rust-analyzer/issues/6448
command = "${rust-analyzer}/bin/rust-analyzer" ''
settings_section = "rust-analyzer" ''
[language.rust.settings.rust-analyzer] [language.bash]
hoverActions.enable = false # kak-lsp doesn't support this at the moment filetypes = ["sh"]
# cargo.features = [] roots = [".git", ".hg"]
# See https://rust-analyzer.github.io/manual.html#configuration command = "${nodePackages.bash-language-server}/bin/bash-language-server"
# If you get 'unresolved proc macro' warnings, you have two options args = ["start"]
# 1. The safe choice is two disable the warning: ''
diagnostics.disabled = ["unresolved-proc-macro"] ];
# 2. Or you can opt-in for proc macro support
procMacro.enable = true
cargo.loadOutDirsFromCheck = true
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
''
) ++ (
lib.optional (pkgs.devEnvironment.enableShell) ''
[language.bash]
filetypes = ["sh"]
roots = [".git", ".hg"]
command = "${nodePackages.bash-language-server}/bin/bash-language-server"
args = ["start"]
''
)
);
} }

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ...}: { pkgs, lib, ...}:
{ {
home.packages = lib.optionals pkgs.devEnvironment.enableLatex [ home.packages = [
pkgs.texlive.combined.scheme-full pkgs.texlive.combined.scheme-full
]; ];
} }

View file

@ -1,6 +1,6 @@
{ {
programs.man = { programs.man = {
enable = true; enable = true;
generateCaches = true; # generateCaches = true;
}; };
} }

View file

@ -1,12 +1,11 @@
{pkgs, lib,...}: {pkgs, lib,...}:
with pkgs; with pkgs;
{ {
home.packages = (lib.optionals pkgs.devEnvironment.enableOffice [ home.packages = [
# libreoffice-fresh # libreoffice-fresh
onlyoffice-bin onlyoffice-bin
]) ++ (lib.optionals pkgs.devEnvironment.enableSpelling [
hunspellDicts.en_GB-large hunspellDicts.en_GB-large
hunspellDicts.en_US-large hunspellDicts.en_US-large
hunspellDicts.it_IT hunspellDicts.it_IT
]); ];
} }

View file

@ -15,6 +15,7 @@ in
rnnoise rnnoise
ardour ardour
# zrythm # zrythm
mixxx
# Plugins # Plugins
# artyFX # artyFX

View file

@ -2,8 +2,7 @@
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
jetbrains.pycharm-professional jetbrains.pycharm-professional
python3 python3
pypy3 # pypy3
]; ];
} }

View file

@ -3,16 +3,16 @@
let let
cmd = link: "${pkgs.google-chrome}/bin/google-chrome-stable --app=${link}"; cmd = link: "${pkgs.google-chrome}/bin/google-chrome-stable --app=${link}";
links = [ links = [
{ desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; icon = builtins.fetchurl "https://mail.protonmail.com/assets/coast-228x228.png"; } { desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Calendar" "Office" ]; }
{ desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; } { desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; }
{ desktopName = "Twitch"; link = "https://www.twitch.tv"; icon = builtins.fetchurl "https://static.twitchcdn.net/assets/favicon-32-e29e246c157142c94346.png"; categories = [ "AudioVideo" ]; } { desktopName = "Monkeytype"; link = "https://monkeytype.com/"; }
{ desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; icon = builtins.fetchurl "https://assets.nflxext.com/us/ffe/siteui/common/icons/nficon2016.png"; } { desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; icon = builtins.fetchurl "https://m.media-amazon.com/images/G/01/digital/video/DVUI/favicons/apple-touch-icon-152x152._CB527404565_.png"; } { desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; }
{ desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; icon = builtins.fetchurl "https://ssl.gstatic.com/keep/keep_2020q4v2.ico"; } { desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Calendar" "Office" ]; icon = builtins.fetchurl "https://calendar.google.com/googlecalendar/images/favicons_2020q4/calendar_31_256.ico"; } { desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; }
{ desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; icon = builtins.fetchurl "https://www.notion.so/images/logo-ios.png"; } { desktopName = "Twitch"; link = "https://www.twitch.tv"; categories = [ "AudioVideo" ]; }
{ desktopName = "WhatsApp"; link = "https://web.whatsapp.com/"; } { desktopName = "WhatsApp"; link = "https://web.whatsapp.com/"; }
{ desktopName = "Monkeytype"; link = "https://monkeytype.com/"; icon = builtins.fetchurl "https://monkeytype.com/images/favicon/apple-touch-icon.png"; } { desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; }
]; ];
webAppBuilder = webAppBuilder =
{ desktopName { desktopName

105
odin.nix
View file

@ -1,32 +1,5 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
nixpkgs.overlays = [
(final: prev: {
devEnvironment = (import ./environment.nix) {
enableCpp = true;
enableData = true;
enableGo = true;
enableHtml = true;
enableJavascript = true;
enableJava = true;
enableLatex = true;
enableNix = true;
enableOffice = true;
enablePython = true;
enableRust = true;
enableShell = true;
enableSpelling = true;
};
cocktail-bar-cli = final.callPackage ./custom/cocktail-bar-cli { };
update-background = final.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; };
lockscreen = final.callPackage ./custom/lockscreen {
palette = final.rice.colorPalette;
font = final.rice.font.normal;
};
})
];
home = { home = {
language.base = "it_IT.UTF-8"; language.base = "it_IT.UTF-8";
keyboard = { keyboard = {
@ -34,8 +7,9 @@
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ]; options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
}; };
packages = with pkgs; [ packages = with pkgs; [
pulseaudio # pulseaudio
easyeffects easyeffects
tex2nix
kubectl kubectl
docker-compose docker-compose
@ -49,32 +23,33 @@
catgirl # IRC catgirl # IRC
cava cava
discord discord
element-desktop droidcam
# element-desktop # matrix client
evolution evolution
file file
filelight
# firefox # firefox
# gallery-dl gallery-dl
gnome.dconf-editor # gnome.dconf-editor
gnome.eog # gnome.eog
gnome.evince # gnome.evince
gnomeExtensions.appindicator # gnomeExtensions.appindicator
gnomeExtensions.caffeine # gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock # gnomeExtensions.dash-to-dock
# gnomeExtensions.dynamic-panel-transparency # # gnomeExtensions.dynamic-panel-transparency
gnomeExtensions.just-perfection # gnomeExtensions.gtile
gnomeExtensions.gtile # gnomeExtensions.just-perfection
gnomeExtensions.vitals # gnomeExtensions.vitals
gnome.file-roller # gnome.file-roller
gnome.gnome-screenshot # gnome.gnome-screenshot
gnome.gnome-sound-recorder gnome.gnome-sound-recorder
gnome.gnome-sudoku gnome.gnome-sudoku
gnome.gnome-system-monitor # gnome.gnome-system-monitor
gnome.gnome-tweaks # gnome.gnome-tweaks
gnome.nautilus # gnome.nautilus
gnome.quadrapassel # gnome.quadrapassel
gnome.seahorse # gnome.seahorse
gnome.sushi # gnome.sushi
tracker
google-chrome google-chrome
gucharmap gucharmap
htop htop
@ -82,28 +57,36 @@
# hyperspace-cli # hyperspace-cli
inkscape inkscape
jetbrains.datagrip jetbrains.datagrip
kcolorchooser
kompare
korganizer
# keepassxc # keepassxc
kgpg
# kid3 # tag mp3
krita krita
# lutris ksystemlog
lutris
meld meld
mmv-go mmv-go
mpv mpv
neofetch neofetch
nixos-option
nix-prefetch-scripts nix-prefetch-scripts
nix-tree nix-tree
nixos-option
obsidian obsidian
okular
openvpn openvpn
p7zip
pavucontrol pavucontrol
pcmanfm pcmanfm
pentablet-driver pentablet-driver
procps procps
p7zip
ripgrep ripgrep
skypeforlinux skypeforlinux
spotify spotify
tdesktop tdesktop
teams teams
tracker
transmission-gtk transmission-gtk
unrar unrar
unzip unzip
@ -134,27 +117,27 @@
./modules/dircolors.nix ./modules/dircolors.nix
./modules/direnv.nix ./modules/direnv.nix
# ./modules/dunst.nix # ./modules/dunst.nix
# ./modules/fzf.nix ./modules/fzf.nix
./modules/git.nix ./modules/git.nix
./modules/go.nix ./modules/go.nix
./modules/gpg.nix ./modules/gpg.nix
./modules/grobi.nix # ./modules/grobi.nix
./modules/info.nix ./modules/info.nix
./modules/java.nix ./modules/java.nix
# ./modules/joystickwake.nix ./modules/joystickwake.nix
./modules/jq.nix ./modules/jq.nix
./modules/kakoune.nix ./modules/kakoune.nix
# ./modules/keepassxc.nix # ./modules/keepassxc.nix
./modules/keychain.nix # ./modules/keychain.nix
./modules/kitty.nix ./modules/kitty.nix
./modules/latex.nix ./modules/latex.nix
./modules/lf.nix ./modules/lf.nix
./modules/libinput-gestures.nix ./modules/libinput-gestures.nix
# ./modules/lorri.nix # ./modules/lorri.nix
./modules/man.nix ./modules/man.nix
# ./modules/mangohud.nix ./modules/mangohud.nix
# ./modules/megasync.nix ./modules/megasync.nix
# ./modules/nix-index.nix ./modules/nix-index.nix
# ./modules/noti.nix # ./modules/noti.nix
./modules/obs-studio.nix ./modules/obs-studio.nix
./modules/office.nix ./modules/office.nix
@ -172,7 +155,7 @@
./modules/syncthing.nix ./modules/syncthing.nix
./modules/terminator.nix ./modules/terminator.nix
./modules/tmux.nix ./modules/tmux.nix
./modules/update_background.nix # ./modules/update_background.nix
./modules/webapp.nix ./modules/webapp.nix
# ./modules/xidlehook.nix # ./modules/xidlehook.nix
./modules/zoxide.nix ./modules/zoxide.nix
@ -189,7 +172,7 @@
# blueman-applet.enable = true; # blueman-applet.enable = true;
# caffeine.enable = true; # caffeine.enable = true;
# cbatticon.enable = true; # cbatticon.enable = true;
gnome-keyring.enable = true; # gnome-keyring.enable = true;
# network-manager-applet.enable = true; # network-manager-applet.enable = true;
# playerctld.enable = true; # playerctld.enable = true;
# poweralertd.enable = true; # poweralertd.enable = true;

View file

@ -60,7 +60,11 @@
# wayland = true; # wayland = true;
# nvidiaWayland = true; # nvidiaWayland = true;
# }; # };
desktopManager.gnome.enable = true; # desktopManager.gnome.enable = true;
desktopManager.plasma5 = {
enable = true;
runUsingSystemd = true;
};
# windowManager.bspwm.enable = true; # windowManager.bspwm.enable = true;
# Configure keymap in X11 # Configure keymap in X11

View file

@ -14,7 +14,12 @@
displayManager.sddm = { displayManager.sddm = {
enable = true; enable = true;
autoNumlock = true; autoNumlock = true;
# enableHidpi = true;
}; };
# displayManager.gdm = {
# enable = true;
# wayland = false;
# };
}; };
hardware.nvidia.prime = { hardware.nvidia.prime = {

View file

@ -1,3 +1,4 @@
[ [
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
] ]