diff --git a/flake.lock b/flake.lock index 6b25ff1..5177c32 100644 --- a/flake.lock +++ b/flake.lock @@ -481,6 +481,29 @@ "type": "github" } }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1705252799, + "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -501,6 +524,34 @@ "type": "github" } }, + "nix-on-droid": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-docs": "nixpkgs-docs", + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd_2" + }, + "locked": { + "lastModified": 1720396533, + "narHash": "sha256-UFzk/hZWO1VkciIO5UPaSpJN8s765wsngUSvtJM6d5Q=", + "owner": "nix-community", + "repo": "nix-on-droid", + "rev": "f3d3b8294039f2f9a8fb7ea82c320f29c6b0fe25", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "nix-on-droid", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1736320768, @@ -517,6 +568,38 @@ "type": "github" } }, + "nixpkgs-docs": { + "locked": { + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1720244366, + "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1740877520, @@ -550,6 +633,28 @@ }, "nmd": { "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmd_2": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs-docs" + ], + "scss-reset": "scss-reset" + }, "locked": { "lastModified": 1705050560, "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", @@ -564,6 +669,38 @@ "type": "sourcehut" } }, + "nmd_3": { + "flake": false, + "locked": { + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" + }, + "original": { + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, "nur": { "inputs": { "flake-parts": "flake-parts_2", @@ -596,7 +733,7 @@ "nixpkgs": [ "nixpkgs" ], - "nmd": "nmd", + "nmd": "nmd_3", "systems": "systems_4" }, "locked": { @@ -621,6 +758,7 @@ "iamb": "iamb", "nbfc-linux": "nbfc-linux", "nix-index-database": "nix-index-database", + "nix-on-droid": "nix-on-droid", "nixpkgs": "nixpkgs_2", "nvf": "nvf", "stylix": "stylix" @@ -666,6 +804,22 @@ "type": "github" } }, + "scss-reset": { + "flake": false, + "locked": { + "lastModified": 1631450058, + "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", + "owner": "andreymatin", + "repo": "scss-reset", + "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", + "type": "github" + }, + "original": { + "owner": "andreymatin", + "repo": "scss-reset", + "type": "github" + } + }, "stylix": { "inputs": { "base16": "base16", diff --git a/flake.nix b/flake.nix index 963dab2..f786205 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,12 @@ url = "github:ulyssa/iamb"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nix-on-droid = { + url = "github:nix-community/nix-on-droid/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; }; outputs = { @@ -60,8 +66,19 @@ home-manager, auto-cpufreq, git-hooks, + nix-on-droid, ... } @ inputs: { + nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { + modules = [inputs.stylix.nixOnDroidModules.stylix ./hosts/andronix/configuration.nix]; + extraSpecialArgs = {inherit inputs;}; + pkgs = import nixpkgs { + system = "aarch64-linux"; + overlays = [ + nix-on-droid.overlays.default + ]; + }; + }; nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ @@ -88,9 +105,15 @@ } ]; }; - devShells.x86_64-linux.default = let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in (import ./shell.nix {inherit pkgs git-hooks;}); + devShells = { + x86_64-linux.default = let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in (import ./shell.nix {inherit pkgs git-hooks;}); + aarch64-linux.default = let + system = "aarch64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in (import ./shell.nix {inherit pkgs git-hooks;}); + }; }; } diff --git a/hosts/andronix/configuration.nix b/hosts/andronix/configuration.nix new file mode 100644 index 0000000..fd38cb1 --- /dev/null +++ b/hosts/andronix/configuration.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: { + # Simply install just the packages + environment.packages = with pkgs; [ + ncurses + busybox + man + openssh + rsync + ]; + + # Backup etc files instead of failing to activate generation if a file already exists in /etc + environment.etcBackupExtension = ".bak"; + + # Read the changelog before changing this value + system.stateVersion = "24.05"; + + # Set up nix for flakes + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + # enable some android integrations. + android-integration.termux-setup-storage.enable = true; + + # Set your time zone + time.timeZone = "Europe/Zagreb"; + + # change to zsh + user.shell = "${pkgs.zsh}/bin/zsh"; + + # Setup font + terminal.font = "${pkgs.nerd-fonts.commit-mono}/share/fonts/opentype/NerdFonts/CommitMono/CommitMonoNerdFont-Regular.otf"; + + # Configure home-manager + home-manager = { + config = ./home.nix; + backupFileExtension = "hm-bak"; + useGlobalPkgs = true; + extraSpecialArgs = {inherit inputs;}; + }; + + # Configure stylix + stylix = { + enable = true; + autoEnable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; + }; +} diff --git a/hosts/andronix/home.nix b/hosts/andronix/home.nix new file mode 100644 index 0000000..d8844b9 --- /dev/null +++ b/hosts/andronix/home.nix @@ -0,0 +1,183 @@ +{ + pkgs, + inputs, + ... +}: { + # Read the changelog before changing this value + home.stateVersion = "24.05"; + + # Packahes + home.packages = with pkgs; [ + alejandra + ]; + + imports = [inputs.nvf.homeManagerModules.default]; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + historySubstringSearch.enable = true; + + dotDir = ".config/zsh"; + + initExtra = '' + # VI Mode escape timeout fix + export KEYTIMEOUT=1 + + # Substring search settings + export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold" + export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold' + bindkey -M vicmd 'k' history-substring-search-up + bindkey -M vicmd 'j' history-substring-search-down + + [[ -f "$HOME/.config/zsh/functions.zsh" ]] && source "$HOME/.config/zsh/functions.zsh" + ''; + + initExtraFirst = '' + # Tmux autostart + if [ -x "$(command -v tmux)" ] && [ -n "$DISPLAY" ] && [ -z "$TMUX" ]; then + exec tmux new-session -A -s default >/dev/null 2>&1 + fi + ''; + + antidote = { + enable = true; + plugins = [ + "zap-zsh/supercharge" + "zap-zsh/completions" + "zap-zsh/vim" + "chivalryq/git-alias" + "zdharma-continuum/fast-syntax-highlighting" + "zsh-users/zsh-history-substring-search" + "MichaelAquilina/zsh-you-should-use" + ]; + }; + }; + + # Enable git + programs.git = { + enable = true; + userName = "Crony Akatsuki"; + userEmail = "crony@cronyakatsuki.xyz"; + }; + + # Install fzf + programs.fzf = { + enable = true; + enableZshIntegration = true; + defaultCommand = "fd --type f"; + }; + + # Install starship + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + add_newline = false; + }; + }; + + # Install zoxide + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; + + # Install eza + programs.eza = { + enable = true; + enableZshIntegration = true; + git = true; + icons = "always"; + }; + + # Install bat + programs.bat.enable = true; + + # Install fd + programs.fd.enable = true; + + # Install ripgrep + programs.ripgrep.enable = true; + + # Install direnv + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + + # Install neovim + programs.nvf = { + enable = true; + settings.vim = { + viAlias = true; + vimAlias = true; + + options = { + tabstop = 2; + shiftwidth = 2; + expandtab = true; + softtabstop = 2; + updatetime = 50; + scrolloff = 5; + signcolumn = "no"; + ignorecase = true; + smartcase = true; + laststatus = 3; + }; + + undoFile.enable = true; + + lsp.enable = true; + + autocomplete.nvim-cmp.enable = true; + + languages = { + enableLSP = true; + enableTreesitter = true; + enableFormat = true; + + nix.enable = true; + }; + + theme = { + enable = true; + name = "gruvbox"; + style = "dark"; + }; + }; + }; + + stylix = { + enable = true; + image = null; + imageScalingMode = "fill"; + polarity = "dark"; + override = {}; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; + autoEnable = false; + cursor = null; + fonts = rec { + sansSerif = { + package = pkgs.dejavu_fonts; + name = "Dejavu Sans"; + }; + serif = sansSerif; + monospace = { + package = pkgs.nerd-fonts.commit-mono; + name = "CommitMono Nerd Font"; + }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + desktop = 10; + terminal = 10; + applications = 10; + }; + }; + }; +}