diff --git a/flake.lock b/flake.lock index 10f22b7..bace6a5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "androidPkgs": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1638562808, + "narHash": "sha256-nnGyBugMQo9WweTgpfPbJu0fHnRtxvsPQ9el2D3wPrY=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "a191ab6adb019b09d3bb919bb98dca31d83519d5", + "type": "github" + }, + "original": { + "owner": "tadfisher", + "ref": "stable", + "repo": "android-nixpkgs", + "type": "github" + } + }, "cachix": { "locked": { "lastModified": 1635350005, @@ -16,6 +37,21 @@ "type": "github" } }, + "devshell": { + "locked": { + "lastModified": 1637575296, + "narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=", + "owner": "numtide", + "repo": "devshell", + "rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "doom-emacs": { "flake": false, "locked": { @@ -171,11 +207,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1698022509, - "narHash": "sha256-6cZh1c4i+AH0ROeyoAGqYDvF5Vo2xkb9pQsimgNuCng=", + "lastModified": 1698927895, + "narHash": "sha256-7zz7AkRRmKHMRcr6RMSJkhCoZqE6n2vQ9tYb5St0NJw=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "5d544a9b5cefec53621bf3688f2277bb6c0293a4", + "rev": "0ce7df614a5fd38f89a95e78cddd251028f8ad48", "type": "github" }, "original": { @@ -251,6 +287,21 @@ "type": "github" } }, + "flake-utils_3": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "format-all": { "flake": false, "locked": { @@ -295,11 +346,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1697976504, - "narHash": "sha256-sU8q83TEaafIe5d7L6Dc2alRhWT898aB0+6EXcfao1I=", + "lastModified": 1698581311, + "narHash": "sha256-27whmW7vBrNruotHJyMuXOWiDdqWyuBhntngpw5bktc=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "2e96d2f9d80f80bd22cd7c603985f2b03cf186fc", + "rev": "0fa525dd0b4f45cabcd510ab83a4d1df3b30d56c", "type": "github" }, "original": { @@ -440,11 +491,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697723726, - "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", "type": "github" }, "original": { @@ -456,11 +507,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1697935651, - "narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=", + "lastModified": 1698540503, + "narHash": "sha256-YN6DJQc7SMe6ep9FhD2BGl92bo24NPNRWjADEJE4xeU=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902", + "rev": "ce2acb20a405bf6f910081c2adc988bbc8100e4c", "type": "github" }, "original": { @@ -469,6 +520,22 @@ "type": "github" } }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1638376152, + "narHash": "sha256-ucgLpVqhFnClH7YRUHBHnmiOd82RZdFR3XJt36ks5fE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6daa4a5c045d40e6eae60a3b6e427e8700f1c07f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1695806987, @@ -486,11 +553,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1698060352, - "narHash": "sha256-c7Thcf2xYTmB4uJpPdb07sPQOIVJWuyjjOfhE4RKq28=", + "lastModified": 1698929167, + "narHash": "sha256-R+6T1131cIQdaHsvxxCdEESyWhM/HQxwufzRPsBWekM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f4d73aae0f51a1ea3161fc97bf05c683d69bf81c", + "rev": "d2288ae0fa6ca56ca3ba777704de6cd3cbb70707", "type": "github" }, "original": { @@ -500,6 +567,38 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1637841632, + "narHash": "sha256-QYqiKHdda0EOnLGQCHE+GluD/Lq2EJj4hVTooPM55Ic=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "73369f8d0864854d1acfa7f1e6217f7d6b6e3fa1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1638371214, + "narHash": "sha256-0kE6KhgH7n0vyuX4aUoGsGIQOqjIx2fJavpCWtn73rc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a640d8394f34714578f3e6335fc767d0755d78f9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nose": { "flake": false, "locked": { @@ -612,6 +711,26 @@ "type": "github" } }, + "robotnix": { + "inputs": { + "androidPkgs": "androidPkgs", + "nixpkgs": "nixpkgs_5", + "nixpkgsUnstable": "nixpkgsUnstable" + }, + "locked": { + "lastModified": 1698517646, + "narHash": "sha256-ttKJDUE8wJ6XYfn06eU8Fb3p82IUvNUV2Hj9cgX3MUI=", + "owner": "nix-community", + "repo": "robotnix", + "rev": "73d6b0b142e3f2844e6caaf820e8be3bd8cde2c6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "robotnix", + "type": "github" + } + }, "root": { "inputs": { "firefox": "firefox", @@ -619,7 +738,8 @@ "nix-doom-emacs": "nix-doom-emacs", "nix-index-database": "nix-index-database", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "robotnix": "robotnix" } }, "rotate-text": { diff --git a/flake.nix b/flake.nix index e27aabd..990fe8c 100644 --- a/flake.nix +++ b/flake.nix @@ -74,6 +74,42 @@ ]; }; + # my server at home + "rpi" = nixpkgs.lib.nixosSystem { + inherit specialArgs; + system = "x86_64-linux"; + }; + + # my raspberry to try out stuff with + "luna" = nixpkgs.lib.nixosSystem { + inherit specialArgs; + system = "x86_64-linux"; + }; + + # my headless nixos vm + "loki" = nixpkgs.lib.nixosSystem { + inherit specialArgs; + system = "x86_64-linux"; + }; + + # a nixos chroot environment + "chroot" = nixpkgs.lib.nixosSystem { + inherit specialArgs; + system = "x86_64-linux"; + + modules = [ + ./hosts/the-most-default.nix + ({ ... }: { + + }) + ]; + }; + + "wsl" = nixpkgs.lib.nixosSystem { + inherit specialArgs; + system = "x86_64-linux"; + }; + "the-most-default" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self; }; @@ -83,12 +119,12 @@ }; }; - robotnixConfigurations = rec { - "phone" = inputs.robotnix.lib.robotnixSystem (import ./hosts/phone/default.nix); - }; + robotnixConfigurations = rec { + "phone" = inputs.robotnix.lib.robotnixSystem (import ./hosts/phone/default.nix); + }; packages.x86_64-linux = { - cbm = nixpkgs.x86_64.callPackage ./mods/cbm.nix { }; + cbm = nixpkgs.legacyPackages.x86_64-linux.callPackage ./mods/cbm.nix { }; #default... TODO run-vm = specialArgs.pkgs.writeScriptBin "run-vm" '' ${self.nixosConfigurations.hpm.config.system.build.vm}/bin/run-hpm-vm -m 4G -cpu host -smp 4 diff --git a/hosts/hpm.nix b/hosts/hpm.nix index d1049c9..a93d660 100644 --- a/hosts/hpm.nix +++ b/hosts/hpm.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ inputs, pkgs, ... }: { imports = [ ../common/all.nix @@ -16,10 +16,15 @@ settings.PermitRootLogin = "yes"; }; + environment.systemPackages = with pkgs; [ + ntfs3g + ]; + nix.settings = { trusted-public-keys = [ "sebastian@c2vi.dev:0tIXGRJMLaI9H1ZPdU4gh+BikUuBVHtk+e1B5HggdZo=" ]; + trusted-users = [ "me" ]; }; users.users.me.openssh.authorizedKeys.keys = [ diff --git a/hosts/main.nix b/hosts/main.nix index 1c75a85..0edb2d7 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -17,15 +17,45 @@ ../common/nixos-graphical.nix ../users/me/default.nix + ../users/root/default.nix ]; nix.settings = { trusted-public-keys = [ "sebastian@c2vi.dev:0tIXGRJMLaI9H1ZPdU4gh+BikUuBVHtk+e1B5HggdZo=" ]; + builders = "@/etc/nix/machines"; + trusted-users = [ "me" ]; }; + nix = { + distributedBuilds = true; + buildMachines = [ + { + hostName = "hpm"; + maxJobs = 8; + speedFactor = 5; + systems = [ + "x86_64-linux" + ]; + } + /* + { + hostName = "main"; + maxJobs = 4; + systems = [ + "x86_64-linux" + ]; + } + */ + ]; + }; networking.hostName = "main"; + networking.search = [ "c2vi.local" ]; + networking.extraHosts = '' + 192.168.1.6 hpm + 192.168.1.2 rpi + ''; # some bind mounts diff --git a/mods/cbm.nix b/mods/cbm.nix index 8e1d60c..157d60a 100644 --- a/mods/cbm.nix +++ b/mods/cbm.nix @@ -1,6 +1,6 @@ { stdenv , fetchFromGitHub -, libncurses +, ncurses }: stdenv.mkDerivation rec { @@ -10,10 +10,11 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "resurrecting-open-source-projects"; repo = "cbm"; - tag = version; + rev = "master"; + sha256 = "sha256-Ubm8jky8nbJZWVSlqipg22ZjlnsgdVmoQWxYi9cyags="; }; nativeBuildInputs = [ - libncurses + ncurses ]; } diff --git a/mybin/nixre b/mybin/nixre index 1e342b6..3f7c5cd 100755 --- a/mybin/nixre +++ b/mybin/nixre @@ -7,7 +7,9 @@ build_from_github(){ export out_path=$(nix build --refresh "github:c2vi/nixos#nixosConfigurations.$host.config.system.build.toplevel" --impure --no-link --print-out-paths $args_to_pass) build_exit_code=$? + echo out_path: $out_path + echo build_exit_code: $build_exit_code return $build_exit_code } @@ -17,6 +19,7 @@ build_from_local(){ build_exit_code=$? echo out_path: $out_path + echo build_exit_code: $build_exit_code return $build_exit_code } diff --git a/mybin/ru b/mybin/ru index c5c167b..ade4407 100755 --- a/mybin/ru +++ b/mybin/ru @@ -18,7 +18,8 @@ wstunnel -L 55555:127.0.0.1:49388 ws://sebastian.dns.army:49389 elif [ "$1" == "speed-test-nixos-iso" ] then -wget "https://dl.t2sde.org/binary/2022/t2-22.6-x86-64-minimal-desktop-gcc-glibc.iso" +wget -O /tmp/speed-test.iso "https://dl.t2sde.org/binary/2022/t2-22.6-x86-64-minimal-desktop-gcc-glibc.iso" +rm /tmp/speed-test.iso elif [ "$1" == "p" ] diff --git a/programs/alacritty.nix b/programs/alacritty.nix index a609bc6..e4bc9b5 100644 --- a/programs/alacritty.nix +++ b/programs/alacritty.nix @@ -1,8 +1,30 @@ -{ ... }: +{ pkgs, ... }: { programs.alacritty = { enable = true; + + # overwrite alacritty package.... to the one with smooth scrolling.... + # for it you also need to add cursor.smooth_factor to the alacritty settings + /* + package = pkgs.alacritty.overrideAttrs ( final: prev: rec { + src = pkgs.fetchFromGitHub { + owner = "gregthemadmonk"; + repo = "alacritty"; + rev = "master"; + sha256 = "2XFHVqXR5RyXpdNd+oimrwGHl4k0qaMzLO+WVGWnQ/M="; + }; + #cargoSha256 = "0000000000000000000000000000000000000000000000000000"; + #cargoSha256 = ""; + + cargoDeps = prev.cargoDeps.overrideAttrs (_: { + inherit src; + outputHash = "sha256-6Gt9ikXrcBXtxHRSvKPEoLoVituxc3rTVDoWlGR4V7A="; + # ... + }); + }); + #*/ settings = { + #cursor.smooth_factor = 0.5; font = { normal = { family = "Hack"; diff --git a/programs/neovim.nix b/programs/neovim.nix index 64e9e6f..824259b 100644 --- a/programs/neovim.nix +++ b/programs/neovim.nix @@ -10,6 +10,7 @@ # typst ... TODO rust-vim dracula-vim + lf-vim ]; coc.enable = true; @@ -74,7 +75,14 @@ :tmap - cnoreabbrev ta Te + nmap :LfNewTab + cnoreabbrev e LfCurrentFile + let g:floaterm_width = 0.88 + let g:floaterm_height = 0.88 + + nmap :wq + imap :wq + cnoreabbrev ta LfNewTab cnoreabbrev hh TSHighlightCapturesUnderCursor nnoremap ga :call CocActionAsync('doHover') @@ -97,7 +105,7 @@ cnoreabbrev s set filetype=javascriptreact - nnoremap lua require('renamer').rename() + "nnoremap lua require('renamer').rename() "cmap t "cmap @@ -168,7 +176,7 @@ """"""""""""""""""""""""""""" languages """"""""""""""""""""""""""""" " ###### nix ###### " - function! Setup_typst() + function! Setup_nix() " use spaces for indentation with nix .. so that multiline strings get stripped of tabs set smartindent set tabstop=2 @@ -183,7 +191,7 @@ " ###### typst ###### " "Typst highlight customisation - function Setup_typst() + function! Setup_typst() " set highlight of Headings to not be underlined "autocmd TermClose * echo v:shell_error "au TermClose * call feedkeys("ii") @@ -232,7 +240,7 @@ " ###### js ###### " set tabstop=3 shiftwidth=3 - function Setup_js() + function! Setup_js() "autocmd Filetype js set tabstop=2 shiftwidth=2 expandtab set tabstop=4 shiftwidth=4 @@ -244,7 +252,7 @@ " ###### c ###### " - function Setup_c() + function! Setup_c() cnoreabbrev c call SaveAndCompile_c() endfunction @@ -262,7 +270,7 @@ let g:UltiSnipsJumpForwardTrigger = '' let g:UltiSnipsJumpBackwardTrigger = '' - function Setup_tex() + function! Setup_tex() set tabstop=2 shiftwidth=2 "command SaveAndCompilelatex cnoreabbrev c call SaveAndCompile_latex() @@ -306,7 +314,7 @@ " ###### vhdl ###### " - function Setup_vhdl() + function! Setup_vhdl() function Vhdl_toggle_comment() let line=getline('.') let chars = split(line, '\zs') @@ -335,7 +343,7 @@ " ###### haskell ###### " - function Setup_haskell() + function! Setup_haskell() set tabstop=4 shiftwidth=4 expandtab "command SaveAndCompile_haskell @@ -374,7 +382,7 @@ " ###### rust ###### " - function Setup_rust() + function! Setup_rust() vnoremap s :call Rust_toggle_comment() diff --git a/programs/ssh.nix b/programs/ssh.nix index 7192aaf..a8246ff 100644 --- a/programs/ssh.nix +++ b/programs/ssh.nix @@ -9,7 +9,7 @@ identityFile = "${secretsDir}/private-key-main"; }; hpm = { - hostname = "192.168.1.6"; + #hostname = "192.168.1.6"; user = "me"; identityFile = "${secretsDir}/private-key-main"; }; @@ -40,6 +40,11 @@ }; }; + home.file.".ssh/known_hosts".text = '' + hpm ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ+FpaNOf+ao6RCa6e43vAHFcQZTGu45rIqAG3Vx0/M8 + hpm ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDbIgfPvt3NUWLxAv0jvWv7IUXHaR7k5M7Z1Kz24K+ZYuPRboHWNbcqGjik0kWDGwXejtTLkyiThK641Q0ffYp3bumKL3b3fBNLoRwHfVMHT9ZuM7e9nALJRa+0keBPTcO9kHliYJlEBiF4jHSZhVDPnZ0Qskg2m94AipKrhUC4KIbLFAERlDnFTxw8LTnzdfzs/n/80zH5tKq1TSlYd2XBIMlzYwxTGEgItifierQhncleVVUJ8IPLsSulMgCQu3BA8cGmdApbSe41FIieIsYzLEtJVnCRt0PymdYa1NdyngJ8ZWyXo6JjTCEHWv35WW05Oiw/tMyUDQoeebACe+Ve9WsYdb+0uttAQWZauODimGY/kRrwy2jCqDRoKjq+rWmTgLsXzuTr7sZ2nmlCIs0XkTXzwduo6ZJ1uNHYWTIjnC1in5uB5TMBlVQxEOdeLOIB9reHP7dajguCGLsOg/a7W/kx181w5MdXq5e9ch7Hp2eC9wBbwcy4EtmX0GAYSPV4GWGwunU92TFE5kg7haV23sdRfLf6ARrDLtsfvTzvoWWQFiO7AgrcOdSQtMUM0/egLUj0lg/A5fxV1pfXvxAF7TquNJCXhDYczCbej4PQM2WBe2eGY+BjY3gDHtUdzWEqhH+b6/Cz78yAa4aSWDB8D+Ejv0N0BZLaImYQhma5PQ== + ''; + home.file.".ssh/rpi/local".text = '' Host config HostName 192.168.1.2 diff --git a/users/me/home.nix b/users/me/home.nix index 4b3ce61..ed05bd1 100644 --- a/users/me/home.nix +++ b/users/me/home.nix @@ -58,12 +58,9 @@ obsidian tree xorg.xkbcomp - rofi haskellPackages.xmonad-extras haskellPackages.xmonad-contrib - alacritty xorg.xev - ntfs3g htop subversion pv @@ -77,7 +74,6 @@ haskellPackages.xmobar dolphin mupdf - zathura xclip rclone stalonetray @@ -108,6 +104,8 @@ delta jq xorg.xkill + wget + xorg.xmodmap inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin diff --git a/users/root/default.nix b/users/root/default.nix new file mode 100644 index 0000000..48420c0 --- /dev/null +++ b/users/root/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + home-manager.users.root = import ./home.nix; +} diff --git a/users/root/home.nix b/users/root/home.nix new file mode 100644 index 0000000..fc39fc9 --- /dev/null +++ b/users/root/home.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + # The home.stateVersion option does not have a default and must be set + home.stateVersion = "23.05"; + + imports = [ + ../../programs/ssh.nix + ]; + + home.file.test.text = "hello world\n"; +}