diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82e0cdf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result \ No newline at end of file diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..53f44ea --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,14 @@ +[env] +project_environment = { value = "production", condition = { env_not_set = ["development"] }} + +[tasks.deploy] +description = "Deploy configuration on the system" +category = "Administration" +command = "home-manager" +args = ["switch"] + +[task.upload] +description = "Upload to repository hosters" +category = "Administration" +command = "git" +args = [ "push dotya central" ] \ No newline at end of file diff --git a/home.nix b/home.nix index d4eb4ca..5752f03 100644 --- a/home.nix +++ b/home.nix @@ -7,27 +7,47 @@ { config, lib, ... }: let # Global variables - homeNixDir = "$HOME/.local/share/home-manager"; + ## NOTE(Krey): Uses `lib.splitString` to remove trailing new-line + ## FIXME(Krey): Doesn't work + #hostname = lib.head (lib.splitString "\n" (builtins.readFile /etc/hostname)); + #hostname = "leonid"; + #domain = "domain"; + # NOTE(Krey): Decide what to do with this + #homeNixDir = "$HOME/.local/share/home-manager"; # NOTE(Krey): Handling of https://github.com/NixOS/nixpkgs/issues/128286 - nixFilesIn = path: - let - names = lib.filter (lib.hasSuffix ".nix") (lib.attrNames (builtins.readDir path)); - in - map (x: path + "/${x}") names; + #nixFilesIn = path: + # let + # names = lib.filter (lib.hasSuffix ".nix") (lib.attrNames (builtins.readDir path)); + # in + # map (x: path + "/${x}") names; in { + #networking.hostName = hostname; + #networking.domain = domain; + imports = [ - (/. + "${homeNixDir}" + /users/kreyren.nix) + ./machines/leonid.nix + # (/. + "/machines/" + "${config.networking.hostName}" + ".nix") + ]; + #++ nixFilesIn ./programs; - (import "${homeNixDir}/machines/${config.networking.hostName}.nix" {inherit homeNixDir;}) - ] ++ nixFilesIn "${homeNixDir}/programs/"; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; - # Use preferred location for home-manager - programs.home-manager.path = "${homeNixDir}"; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "kreyren"; + home.homeDirectory = "/home/kreyren"; + + home.stateVersion = "21.05"; # Global packages programs.bash.enable = true; programs.vim.enable = true; + programs.alacritty.enable = true; + programs.firefox.enable = true; programs.gpg.enable = true; + programs.gnupg.enable = true; + programs.git.enable = true; programs.htop.enable = true; -} \ No newline at end of file +} diff --git a/machines/leonid.nix b/machines/leonid.nix index 093736d..4b83b3f 100644 --- a/machines/leonid.nix +++ b/machines/leonid.nix @@ -1,4 +1,7 @@ { config, pkgs, ... }: { # NOTE(Krey): Just so there is something here programs.vim.enable = true; + + # FIXME(Krey): Blocked by https://github.com/nix-community/home-manager/issues/2152 + #programs.freetube.enable = true; } \ No newline at end of file diff --git a/programs/git.nix b/programs/git.nix index 4ff695a..a9543c5 100644 --- a/programs/git.nix +++ b/programs/git.nix @@ -4,4 +4,10 @@ userEmail = "kreyren@fsfe.org"; # FIXME(Krey): Use tor for proxy if it's set up on the system }; + + # NOTE(Krey): Fix for `No pinentry` error + programs.gnupg.agent = { + enableSSHSupport = true; + pinentryFlavor = "curses"; + } } \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..11b5d26 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +# NixOS shell configuration to bootstrap the required dependencies +# NOTE(Krey): Uses mozilla's overlay, because nix's upstream is slow + +{ pkgs ? import {} }: + pkgs.mkShell { + nativeBuildInputs = [ pkgs.buildPackages.cargo-make ]; +} \ No newline at end of file