From 7235dc60dd4e04f6dac634fd6a824c781305fb58 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 20 Dec 2022 19:58:39 +0000 Subject: [PATCH] refactor: delete old Ansible configuration - Remove the Ansible files. - Move the Nix files to the root level of the repository. Refs: #39 --- ansible.cfg | 3 - .../pop-os/default.nix | 0 .../wsl2/default.nix | 0 group_vars/all | 47 --- .../home-manager => home-manager}/apollo.nix | 0 .../modules/common.nix | 23 +- .../modules/git.nix | 0 .../modules/home-manager.nix | 0 .../modules/tmux.nix | 0 .../modules/zsh.nix | 0 hosts.ini | 2 - main.yaml | 23 -- nix/sources.json | 14 - nix/sources.nix | 194 ------------ .../nixos => nixos}/apollo/configuration.nix | 8 + {nixpkgs/nixos => nixos}/apollo/default.nix | 0 .../apollo/hardware-configuration.nix | 0 requirements.yml | 2 - roles/awesome-wm/tasks/main.yaml | 7 - roles/cargo/tasks/main.yaml | 7 - roles/copyq/tasks/main.yaml | 7 - roles/ctop/tasks/main.yaml | 7 - roles/dconf/files/dconf-settings.ini | 23 -- roles/dconf/tasks/main.yaml | 6 - roles/debugger/tasks/main.yaml | 4 - roles/debugger/tasks/php.yaml | 22 -- roles/delta/meta/main.yaml | 3 - roles/delta/tasks/main.yaml | 8 - roles/discord/tasks/main.yaml | 7 - roles/docker/tasks/main.yaml | 22 -- roles/filezilla/tasks/main.yaml | 7 - roles/flameshot/tasks/main.yaml | 7 - roles/fonts/tasks/main.yaml | 14 - roles/fzf/tasks/main.yaml | 7 - roles/git/files/.gitconfig | 138 --------- roles/git/files/.gitignore | 10 - roles/git/files/.gitignore-global | 43 --- roles/git/files/.gitmessage | 16 - roles/git/tasks/main.yaml | 24 -- roles/git/templates/gitconfig.local.j2 | 3 - roles/github-cli/tasks/main.yaml | 26 -- roles/github-desktop/tasks/main.yaml | 7 - roles/gnome-tweak-tools/tasks/main.yaml | 7 - roles/google-chrome/tasks/main.yaml | 7 - roles/htop/tasks/main.yaml | 7 - roles/jq/tasks/main.yaml | 7 - roles/kdenlive/tasks/main.yaml | 7 - roles/mysql-client/tasks/main.yaml | 7 - roles/notion-app/tasks/main.yaml | 12 - roles/npm/tasks/main.yaml | 7 - roles/obs-studio/tasks/main.yaml | 7 - roles/pdf-arranger/tasks/main.yaml | 7 - roles/platformsh-cli/tasks/main.yaml | 30 -- roles/pocketcasts/tasks/main.yaml | 7 - roles/postman/tasks/main.yaml | 7 - roles/projects/meta/main.yaml | 3 - roles/projects/tasks/main.yaml | 22 -- roles/pulumi/tasks/main.yaml | 23 -- roles/pv/tasks/main.yaml | 7 - roles/ripgrep/tasks/main.yaml | 7 - roles/skype/tasks/main.yaml | 7 - roles/slack/tasks/main.yaml | 7 - roles/spotify/tasks/main.yaml | 7 - roles/ssh/tasks/main.yaml | 18 -- roles/stylua/meta/main.yaml | 3 - roles/stylua/tasks/main.yaml | 8 - roles/tldr/tasks/main.yaml | 7 - roles/tmux/files/tmux.conf | 95 ------ roles/tmux/tasks/main.yaml | 18 -- roles/tmuxinator/tasks/main.yml | 27 -- roles/todoist/tasks/main.yaml | 7 - roles/tree/tasks/main.yaml | 7 - roles/vlc/tasks/main.yaml | 7 - roles/zoom/tasks/main.yaml | 7 - roles/zsh-antigen/tasks/main.yaml | 5 - roles/zsh/files/.zshenv | 7 - roles/zsh/files/config/.zshrc | 28 -- roles/zsh/files/config/completion-scripts/_g | 3 - roles/zsh/files/config/completion-scripts/_m | 2 - roles/zsh/files/config/configs/aliases.zsh | 11 - roles/zsh/files/config/configs/colour.zsh | 4 - roles/zsh/files/config/configs/functions.zsh | 38 --- roles/zsh/files/config/configs/fzf.zsh | 2 - roles/zsh/files/config/configs/general.zsh | 5 - roles/zsh/files/config/configs/history.zsh | 7 - roles/zsh/files/config/configs/navigation.zsh | 9 - roles/zsh/files/config/configs/nvm.zsh | 2 - roles/zsh/files/config/configs/options.zsh | 3 - roles/zsh/files/config/configs/path.zsh | 25 -- roles/zsh/files/config/configs/platformsh.zsh | 6 - roles/zsh/files/config/configs/plugins.zsh | 10 - .../zsh/files/config/configs/plugins.zsh.zwc | Bin 912 -> 0 bytes .../files/config/configs/post/completion.zsh | 8 - roles/zsh/files/config/configs/prompt.zsh | 34 --- roles/zsh/files/config/functions/g | 9 - roles/zsh/files/config/functions/run | 8 - roles/zsh/files/config/oh-my-zsh/git.zsh | 281 ------------------ roles/zsh/tasks/main.yaml | 34 --- 98 files changed, 28 insertions(+), 1660 deletions(-) delete mode 100644 ansible.cfg rename {nixpkgs/configuration => configuration}/pop-os/default.nix (100%) rename {nixpkgs/configuration => configuration}/wsl2/default.nix (100%) delete mode 100644 group_vars/all rename {nixpkgs/home-manager => home-manager}/apollo.nix (100%) rename {nixpkgs/home-manager => home-manager}/modules/common.nix (84%) rename {nixpkgs/home-manager => home-manager}/modules/git.nix (100%) rename {nixpkgs/home-manager => home-manager}/modules/home-manager.nix (100%) rename {nixpkgs/home-manager => home-manager}/modules/tmux.nix (100%) rename {nixpkgs/home-manager => home-manager}/modules/zsh.nix (100%) delete mode 100644 hosts.ini delete mode 100644 main.yaml delete mode 100644 nix/sources.json delete mode 100644 nix/sources.nix rename {nixpkgs/nixos => nixos}/apollo/configuration.nix (96%) rename {nixpkgs/nixos => nixos}/apollo/default.nix (100%) rename {nixpkgs/nixos => nixos}/apollo/hardware-configuration.nix (100%) delete mode 100644 requirements.yml delete mode 100644 roles/awesome-wm/tasks/main.yaml delete mode 100644 roles/cargo/tasks/main.yaml delete mode 100644 roles/copyq/tasks/main.yaml delete mode 100644 roles/ctop/tasks/main.yaml delete mode 100644 roles/dconf/files/dconf-settings.ini delete mode 100644 roles/dconf/tasks/main.yaml delete mode 100644 roles/debugger/tasks/main.yaml delete mode 100644 roles/debugger/tasks/php.yaml delete mode 100644 roles/delta/meta/main.yaml delete mode 100644 roles/delta/tasks/main.yaml delete mode 100644 roles/discord/tasks/main.yaml delete mode 100644 roles/docker/tasks/main.yaml delete mode 100644 roles/filezilla/tasks/main.yaml delete mode 100644 roles/flameshot/tasks/main.yaml delete mode 100644 roles/fonts/tasks/main.yaml delete mode 100644 roles/fzf/tasks/main.yaml delete mode 100644 roles/git/files/.gitconfig delete mode 100644 roles/git/files/.gitignore delete mode 100644 roles/git/files/.gitignore-global delete mode 100644 roles/git/files/.gitmessage delete mode 100644 roles/git/tasks/main.yaml delete mode 100644 roles/git/templates/gitconfig.local.j2 delete mode 100644 roles/github-cli/tasks/main.yaml delete mode 100644 roles/github-desktop/tasks/main.yaml delete mode 100644 roles/gnome-tweak-tools/tasks/main.yaml delete mode 100644 roles/google-chrome/tasks/main.yaml delete mode 100644 roles/htop/tasks/main.yaml delete mode 100644 roles/jq/tasks/main.yaml delete mode 100644 roles/kdenlive/tasks/main.yaml delete mode 100644 roles/mysql-client/tasks/main.yaml delete mode 100644 roles/notion-app/tasks/main.yaml delete mode 100644 roles/npm/tasks/main.yaml delete mode 100644 roles/obs-studio/tasks/main.yaml delete mode 100644 roles/pdf-arranger/tasks/main.yaml delete mode 100644 roles/platformsh-cli/tasks/main.yaml delete mode 100644 roles/pocketcasts/tasks/main.yaml delete mode 100644 roles/postman/tasks/main.yaml delete mode 100644 roles/projects/meta/main.yaml delete mode 100644 roles/projects/tasks/main.yaml delete mode 100644 roles/pulumi/tasks/main.yaml delete mode 100644 roles/pv/tasks/main.yaml delete mode 100644 roles/ripgrep/tasks/main.yaml delete mode 100644 roles/skype/tasks/main.yaml delete mode 100644 roles/slack/tasks/main.yaml delete mode 100644 roles/spotify/tasks/main.yaml delete mode 100644 roles/ssh/tasks/main.yaml delete mode 100644 roles/stylua/meta/main.yaml delete mode 100644 roles/stylua/tasks/main.yaml delete mode 100644 roles/tldr/tasks/main.yaml delete mode 100644 roles/tmux/files/tmux.conf delete mode 100644 roles/tmux/tasks/main.yaml delete mode 100644 roles/tmuxinator/tasks/main.yml delete mode 100644 roles/todoist/tasks/main.yaml delete mode 100644 roles/tree/tasks/main.yaml delete mode 100644 roles/vlc/tasks/main.yaml delete mode 100644 roles/zoom/tasks/main.yaml delete mode 100644 roles/zsh-antigen/tasks/main.yaml delete mode 100644 roles/zsh/files/.zshenv delete mode 100644 roles/zsh/files/config/.zshrc delete mode 100644 roles/zsh/files/config/completion-scripts/_g delete mode 100644 roles/zsh/files/config/completion-scripts/_m delete mode 100644 roles/zsh/files/config/configs/aliases.zsh delete mode 100644 roles/zsh/files/config/configs/colour.zsh delete mode 100644 roles/zsh/files/config/configs/functions.zsh delete mode 100644 roles/zsh/files/config/configs/fzf.zsh delete mode 100644 roles/zsh/files/config/configs/general.zsh delete mode 100644 roles/zsh/files/config/configs/history.zsh delete mode 100644 roles/zsh/files/config/configs/navigation.zsh delete mode 100644 roles/zsh/files/config/configs/nvm.zsh delete mode 100644 roles/zsh/files/config/configs/options.zsh delete mode 100644 roles/zsh/files/config/configs/path.zsh delete mode 100644 roles/zsh/files/config/configs/platformsh.zsh delete mode 100644 roles/zsh/files/config/configs/plugins.zsh delete mode 100644 roles/zsh/files/config/configs/plugins.zsh.zwc delete mode 100644 roles/zsh/files/config/configs/post/completion.zsh delete mode 100644 roles/zsh/files/config/configs/prompt.zsh delete mode 100644 roles/zsh/files/config/functions/g delete mode 100644 roles/zsh/files/config/functions/run delete mode 100644 roles/zsh/files/config/oh-my-zsh/git.zsh delete mode 100644 roles/zsh/tasks/main.yaml diff --git a/ansible.cfg b/ansible.cfg deleted file mode 100644 index 5b1bf96..0000000 --- a/ansible.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -become = true -inventory = ./hosts.ini diff --git a/nixpkgs/configuration/pop-os/default.nix b/configuration/pop-os/default.nix similarity index 100% rename from nixpkgs/configuration/pop-os/default.nix rename to configuration/pop-os/default.nix diff --git a/nixpkgs/configuration/wsl2/default.nix b/configuration/wsl2/default.nix similarity index 100% rename from nixpkgs/configuration/wsl2/default.nix rename to configuration/wsl2/default.nix diff --git a/group_vars/all b/group_vars/all deleted file mode 100644 index b08b960..0000000 --- a/group_vars/all +++ /dev/null @@ -1,47 +0,0 @@ -default_roles: - - awesome-wm - - cargo - - copyq - - ctop - - dconf - - debugger - - delta - - discord - - docker - - filezilla - - flameshot - - fonts - - fzf - - git - - github-cli - - github-desktop - - gnome-tweak-tools - - google-chrome - - htop - - jq - - kdenlive - - mysql-client - - notion-app - - npm - - obs-studio - - pdf-arranger - - platformsh-cli - - pocketcasts - - postman - - projects - - pulumi - - pv - - ripgrep - - skype - - slack - - ssh - - stylua - - tldr - - tmux - - tmuxinator - - todoist - - tree - - vlc - - zoom - - zsh - - zsh-antigen diff --git a/nixpkgs/home-manager/apollo.nix b/home-manager/apollo.nix similarity index 100% rename from nixpkgs/home-manager/apollo.nix rename to home-manager/apollo.nix diff --git a/nixpkgs/home-manager/modules/common.nix b/home-manager/modules/common.nix similarity index 84% rename from nixpkgs/home-manager/modules/common.nix rename to home-manager/modules/common.nix index c145584..dc415f2 100644 --- a/nixpkgs/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -38,8 +38,9 @@ zoxide # LSP + gopls html-tidy - nodePackages."@ansible/ansible-language-server" + # nodePackages."@ansible/ansible-language-server" nodePackages."@tailwindcss/language-server" nodePackages.bash-language-server nodePackages.dockerfile-language-server-nodejs @@ -71,11 +72,23 @@ owner = "phpactor"; repo = "phpactor"; rev = "master"; - sha256 = "j2rGPMiST85feqk5Nj4KrjxyhfbUjYEKAec+bzPEJZQ="; + sha256 = "0bgfwidrlaqxnjmk14gqc8b0mxh0c5xf098qcjz9mvw236n88xl7"; + }; + }; + + vim-astro = pkgs.vimUtils.buildVimPlugin { + name = "vim-astro"; + src = pkgs.fetchFromGitHub { + owner = "wuelnerdotexe"; + repo = "vim-astro"; + rev = "main"; + sha256 = "HyQ4i/T1uQmGurBqCpo8+ESVSVPsTrLQBxLe2OEYjcY="; }; }; in with pkgs.vimPlugins; [ + vim-astro + comment-nvim git-worktree-nvim gitsigns-nvim @@ -110,7 +123,6 @@ null-ls-nvim nvim-lspconfig lsp-status-nvim - phpactor # Completion cmp-buffer @@ -135,13 +147,18 @@ telescope-nvim telescope-ui-select-nvim + # Git + # neogit + # Databases vim-dadbod vim-dadbod-ui vim-dadbod-completion # Themes + catppuccin-nvim nightfox-nvim + onehalf ]; }; diff --git a/nixpkgs/home-manager/modules/git.nix b/home-manager/modules/git.nix similarity index 100% rename from nixpkgs/home-manager/modules/git.nix rename to home-manager/modules/git.nix diff --git a/nixpkgs/home-manager/modules/home-manager.nix b/home-manager/modules/home-manager.nix similarity index 100% rename from nixpkgs/home-manager/modules/home-manager.nix rename to home-manager/modules/home-manager.nix diff --git a/nixpkgs/home-manager/modules/tmux.nix b/home-manager/modules/tmux.nix similarity index 100% rename from nixpkgs/home-manager/modules/tmux.nix rename to home-manager/modules/tmux.nix diff --git a/nixpkgs/home-manager/modules/zsh.nix b/home-manager/modules/zsh.nix similarity index 100% rename from nixpkgs/home-manager/modules/zsh.nix rename to home-manager/modules/zsh.nix diff --git a/hosts.ini b/hosts.ini deleted file mode 100644 index 45b5d23..0000000 --- a/hosts.ini +++ /dev/null @@ -1,2 +0,0 @@ -[localhost] -127.0.0.1 ansible_connection=local diff --git a/main.yaml b/main.yaml deleted file mode 100644 index d8884bd..0000000 --- a/main.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- hosts: localhost - tasks: - - name: Set roles - ansible.builtin.set_fact: - roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(exclude_roles | default([])) }}" - tags: - - always - - - name: Display roles - ansible.builtin.debug: "var=roles" - tags: - - always - - - name: Run roles - ansible.builtin.include_role: - name: "{{ item }}" - apply: - tags: - - "{{ item }}" - with_items: "{{ roles }}" - tags: - - always diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 5c20860..0000000 --- a/nix/sources.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "nixpkgs": { - "branch": "release-21.05", - "description": "Nix Packages collection", - "homepage": "", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5f244caea76105b63d826911b2a1563d33ff1cdc", - "sha256": "1xlgynfw9svy7nvh9nkxsxdzncv9hg99gbvbwv3gmrhmzc3sar75", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5f244caea76105b63d826911b2a1563d33ff1cdc.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index 9a01c8a..0000000 --- a/nix/sources.nix +++ /dev/null @@ -1,194 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; - - fetch_tarball = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; - - fetch_git = name: spec: - let - ref = - if spec ? ref then spec.ref else - if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; - submodules = if spec ? submodules then spec.submodules else false; - submoduleArg = - let - nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; - emptyArgWithWarning = - if submodules == true - then - builtins.trace - ( - "The niv input \"${name}\" uses submodules " - + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " - + "does not support them" - ) - {} - else {}; - in - if nixSupportsSubmodules - then { inherit submodules; } - else emptyArgWithWarning; - in - builtins.fetchGit - ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); - - fetch_local = spec: spec.path; - - fetch_builtin-tarball = name: throw - ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; - - fetch_builtin-url = name: throw - ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; - - # - # Various helpers - # - - # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 - sanitizeName = name: - ( - concatMapStrings (s: if builtins.isList s then "-" else s) - ( - builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) - ) - ); - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: system: - let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; - hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; - hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - # The actual fetching function. - fetch = pkgs: name: spec: - - if ! builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs name spec - else if spec.type == "tarball" then fetch_tarball pkgs name spec - else if spec.type == "git" then fetch_git name spec - else if spec.type == "local" then fetch_local spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball name - else if spec.type == "builtin-url" then fetch_builtin-url name - else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # If the environment variable NIV_OVERRIDE_${name} is set, then use - # the path directly as opposed to the fetched source. - replace = name: drv: - let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; - ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); - concatMapStrings = f: list: concatStrings (map f list); - concatStrings = builtins.concatStringsSep ""; - - # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; - - # The "config" used by the fetchers - mkConfig = - { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem - , pkgs ? mkPkgs sources system - }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; - -in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/nixpkgs/nixos/apollo/configuration.nix b/nixos/apollo/configuration.nix similarity index 96% rename from nixpkgs/nixos/apollo/configuration.nix rename to nixos/apollo/configuration.nix index a980dec..0e86fcd 100644 --- a/nixpkgs/nixos/apollo/configuration.nix +++ b/nixos/apollo/configuration.nix @@ -162,4 +162,12 @@ in fonts.fonts = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) ]; + + services.cron = { + enable = true; + + systemCronJobs = [ + "0 9 * * * opdavies find ~/Downloads -daystart -mtime +2 -delete -print >> /tmp/cron.log" + ]; + }; } diff --git a/nixpkgs/nixos/apollo/default.nix b/nixos/apollo/default.nix similarity index 100% rename from nixpkgs/nixos/apollo/default.nix rename to nixos/apollo/default.nix diff --git a/nixpkgs/nixos/apollo/hardware-configuration.nix b/nixos/apollo/hardware-configuration.nix similarity index 100% rename from nixpkgs/nixos/apollo/hardware-configuration.nix rename to nixos/apollo/hardware-configuration.nix diff --git a/requirements.yml b/requirements.yml deleted file mode 100644 index 72fe72d..0000000 --- a/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ -collections: - - name: community.general diff --git a/roles/awesome-wm/tasks/main.yaml b/roles/awesome-wm/tasks/main.yaml deleted file mode 100644 index 98dcbcf..0000000 --- a/roles/awesome-wm/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - awesome - state: latest - become: true diff --git a/roles/cargo/tasks/main.yaml b/roles/cargo/tasks/main.yaml deleted file mode 100644 index 793c7d5..0000000 --- a/roles/cargo/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - cargo - state: latest - become: true diff --git a/roles/copyq/tasks/main.yaml b/roles/copyq/tasks/main.yaml deleted file mode 100644 index 10f28fe..0000000 --- a/roles/copyq/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.github.hluk.copyq - method: user - state: present diff --git a/roles/ctop/tasks/main.yaml b/roles/ctop/tasks/main.yaml deleted file mode 100644 index 76fc0dc..0000000 --- a/roles/ctop/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - ctop - state: latest - become: true diff --git a/roles/dconf/files/dconf-settings.ini b/roles/dconf/files/dconf-settings.ini deleted file mode 100644 index fe38aeb..0000000 --- a/roles/dconf/files/dconf-settings.ini +++ /dev/null @@ -1,23 +0,0 @@ -[org/gnome/desktop/wm/keybindings] -move-to-workspace-1=['Home', '1'] -move-to-workspace-2=['2'] -move-to-workspace-3=['3'] -move-to-workspace-3=['3'] -move-to-workspace-4=['4'] -move-to-workspace-4=['4'] -move-to-workspace-5=['5'] -move-to-workspace-6=['6'] -move-to-workspace-7=['7'] -move-to-workspace-8=['8'] -move-to-workspace-9=['9'] -move-to-workspace-10=['0'] -switch-to-workspace-1=['1'] -switch-to-workspace-2=['2'] -switch-to-workspace-3=['3'] -switch-to-workspace-4=['4'] -switch-to-workspace-5=['5'] -switch-to-workspace-6=['6'] -switch-to-workspace-7=['7'] -switch-to-workspace-8=['8'] -switch-to-workspace-9=['9'] -switch-to-workspace-10=['0'] diff --git a/roles/dconf/tasks/main.yaml b/roles/dconf/tasks/main.yaml deleted file mode 100644 index dad5c45..0000000 --- a/roles/dconf/tasks/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Configure - ansible.builtin.file: - src: "{{ role_path }}/files/dconf-settings.ini" - dest: "{{ ansible_user_dir }}/.config/dconf-settings.ini" - state: link diff --git a/roles/debugger/tasks/main.yaml b/roles/debugger/tasks/main.yaml deleted file mode 100644 index 59cc5b7..0000000 --- a/roles/debugger/tasks/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include_tasks: php.yaml - tags: - - debugger diff --git a/roles/debugger/tasks/php.yaml b/roles/debugger/tasks/php.yaml deleted file mode 100644 index 966b45d..0000000 --- a/roles/debugger/tasks/php.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: Clone - ansible.builtin.git: - depth: 1 - dest: "{{ ansible_user_dir }}/build/vscode-php-debug" - force: yes - repo: https://github.com/xdebug/vscode-php-debug.git - single_branch: yes - register: clone - tags: - - debugger - -- name: Install - ansible.builtin.command: | - npm install - npm run build - args: - chdir: "{{ ansible_user_dir }}/build/vscode-php-debug" - creates: "{{ ansible_user_dir }}/build/vscode-php-debug/out" - when: clone.changed - tags: - - debugger diff --git a/roles/delta/meta/main.yaml b/roles/delta/meta/main.yaml deleted file mode 100644 index fe55fc7..0000000 --- a/roles/delta/meta/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: cargo diff --git a/roles/delta/tasks/main.yaml b/roles/delta/tasks/main.yaml deleted file mode 100644 index 30e3bcf..0000000 --- a/roles/delta/tasks/main.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Install - community.general.cargo: - name: - - git-delta - path: /usr/local - state: latest - become: true diff --git a/roles/discord/tasks/main.yaml b/roles/discord/tasks/main.yaml deleted file mode 100644 index 1ff8738..0000000 --- a/roles/discord/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.discordapp.Discord - method: user - state: present diff --git a/roles/docker/tasks/main.yaml b/roles/docker/tasks/main.yaml deleted file mode 100644 index a9e0747..0000000 --- a/roles/docker/tasks/main.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - docker - - docker-compose - state: latest - become: yes - -- name: Enable service - ansible.builtin.systemd: - enabled: yes - name: docker - state: started - become: yes - -- name: Add to group - ansible.builtin.user: - append: yes - groups: docker - name: "{{ ansible_env['USER'] }}" - become: yes diff --git a/roles/filezilla/tasks/main.yaml b/roles/filezilla/tasks/main.yaml deleted file mode 100644 index 96aee28..0000000 --- a/roles/filezilla/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - org.filezillaproject.Filezilla - method: user - state: present diff --git a/roles/flameshot/tasks/main.yaml b/roles/flameshot/tasks/main.yaml deleted file mode 100644 index 195154f..0000000 --- a/roles/flameshot/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - org.flameshot.Flameshot - method: user - state: present diff --git a/roles/fonts/tasks/main.yaml b/roles/fonts/tasks/main.yaml deleted file mode 100644 index 50fc8f2..0000000 --- a/roles/fonts/tasks/main.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Download - ansible.builtin.get_url: - dest: "{{ font_item.dest }}" - url: "{{ font_item.url }}" - loop_control: - loop_var: font_item - loop: - - url: "https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete%20Mono.ttf?raw=true" - dest: /usr/share/fonts/truetype/JetBrainsMono Nerd Font Regular - - - url: "https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/Ligatures/Italic/complete/JetBrains%20Mono%20Italic%20Nerd%20Font%20Complete%20Mono.ttf?raw=true" - dest: /usr/share/fonts/truetype/JetBrainsMono Nerd Font Italic - become: true diff --git a/roles/fzf/tasks/main.yaml b/roles/fzf/tasks/main.yaml deleted file mode 100644 index aa70668..0000000 --- a/roles/fzf/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - fzf - state: latest - become: true diff --git a/roles/git/files/.gitconfig b/roles/git/files/.gitconfig deleted file mode 100644 index 4c56620..0000000 --- a/roles/git/files/.gitconfig +++ /dev/null @@ -1,138 +0,0 @@ -[alias] - aa = add --all - assume = update-index --assume-unchanged - assumed = !git ls-files -v | grep '^[hsmrck?]' | cut -c 3- - b = branch - browse = !gh repo view --web - ca = commit --amend --verbose - car = commit --amend --no-edit - cl = !hub clone - cl = !hub clone - co = checkout - compare = !hub compare - current-branch = rev-parse --abbrev-ref HEAD - dc = diff --color --word-diff --cached - df = diff --color --word-diff - dup = !git checkout develop && git fetch origin && echo && git sl develop..origin/develop && echo && git pull --quiet && git checkout - - fixup = commit --fixup - issues = !gh issue list --web - mup = !git master-to-main-wrapper checkout %BRANCH% && git fetch origin && echo && git sl %BRANCH%..origin/%BRANCH% && echo && git pull --quiet && git checkout - - nah = !git reset --hard && git clean -fd - no-ff = merge --no-ff - pl = pull - prune = remote prune origin - ps = push - pulls = !gh pr list --web - rbc = rebase --continue - rdup = !git dup && git rebase develop - remotes = remote -v - repush = !git pull --rebase && git push - ri = rebase --interactive - rid = !git rebase -i $(git merge-base develop HEAD) - rim = !git rebase -i $(git master-to-main-wrapper merge-base %BRANCH% HEAD) - rip = !git rebase -i $(git merge-base production HEAD) - ris = !git rebase -i $(git merge-base staging HEAD) - riu = !git rebase -i $(git rev-parse --abbrev-ref --symbolic-full-name @{u}) - rmup = !git mup && git master-to-main-wrapper rebase %BRANCH% - sl = log --oneline --decorate -20 - sla = log --oneline --decorate --graph --all -20 - slap = log --oneline --decorate --graph --all - slp = log --oneline --decorate - staged = diff --staged - unassume = update-index --no-assume-unchanged - uncommit = reset --soft HEAD^ - unstage = reset - upstream = rev-parse --abbrev-ref --symbolic-full-name @{u} - ureset = !git reset --hard $(git upstream) - wip = !git add . && git commit -m 'wip' - worktrees = "worktree list" - -[branch] - autosetupmerge = true - autosetuprebase = always - -[checkout] - defaultRemote = origin - -[color] - branch = auto - diff = auto - status = auto - ui = true - -[color "branch"] - current = red reverse - local = blue - remote = green - -[color "diff"] - meta = yellow - frag = magenta - old = red bold - new = green - plain = white - -[color "status"] - added = yellow - changed = green - untracked = cyan - -[commit] - template = ~/.gitmessage - verbose = true - -[core] - editor = nvim - excludesFile = ~/.gitignore-global - pager = delta - -[delta] - line-numbers = true - -[diff] - tool = vimdiff - -[fetch] - prune = true - -[gitsh] - nogreeting = true - -[grep] - lineNumber = true - -[help] - autocorrect = 1 - -[include] - path = ~/.gitconfig.local - -[init] - templatedir = ~/.git_template - -[merge] - ff = only - -[rebase] - autosquash = true - autostash = true - -[rerere] - enabled = true - -[push] - default = upstream - -[url "https://git.drupal.org/project/"] - insteadOf = do: - insteadOf = drupal: - -[pull] - ff = only - rebase = true - -[filter "lfs"] - process = git-lfs filter-process - required = true - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f diff --git a/roles/git/files/.gitignore b/roles/git/files/.gitignore deleted file mode 100644 index b3817e5..0000000 --- a/roles/git/files/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -* -!*/ -!/bin/** -!/tag-*/** -/tag-php/composer/.env -/tag-php/composer/auth.json -/tag-php/composer/bin/ -/tag-php/composer/config/ -/tag-php/composer/keys.*.pub -/**/*.zwc diff --git a/roles/git/files/.gitignore-global b/roles/git/files/.gitignore-global deleted file mode 100644 index 30ff857..0000000 --- a/roles/git/files/.gitignore-global +++ /dev/null @@ -1,43 +0,0 @@ -# Ignore archive files. -*.7z -*.dmg -*.gz -*.iso -*.phar -*.phar.version -*.rar -*.tar -*.zip - -# Ignore database exports. -*.*sql - -# Ignore patch files and interdiffs. -*.patch -*.diff -*.rej -*.orig -interdiff*.txt - -# Ignore Vagrant directories. -.vagrant/ - -# Ignore logs. -*.log - -# Ignore IDE and text editor files. -.idea/ -*.sublime-* - -# Ignore temporary directories. -.php_cs.cache -tmp/ - -# Ignore Ansible Playbook retrys. -*.retry - -# Ignore notes within projects. -.notes/ - -# Ignore directory level aliases -.aliases diff --git a/roles/git/files/.gitmessage b/roles/git/files/.gitmessage deleted file mode 100644 index 91df68d..0000000 --- a/roles/git/files/.gitmessage +++ /dev/null @@ -1,16 +0,0 @@ - - -# 50-character subject line -# -# 72-character wrapped longer description. This should answer: -# -# * Why was this change necessary? -# * How does it address the problem? -# * Are there any side effects? -# -# Include a link to the ticket, if any. -# -# Add co-authors if you worked on this code with others: -# -# Co-authored-by: Full Name -# Co-authored-by: Full Name diff --git a/roles/git/tasks/main.yaml b/roles/git/tasks/main.yaml deleted file mode 100644 index d35e7c7..0000000 --- a/roles/git/tasks/main.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - git - state: latest - become: true - -- name: Configuration - ansible.builtin.file: - src: "{{ role_path }}/files/{{ git_config_item }}" - dest: "{{ ansible_user_dir }}/{{ git_config_item }}" - state: link - loop_control: - loop_var: git_config_item - with_items: - - .gitconfig - - .gitignore-global - - .gitmessage - -- name: Local configuration - ansible.builtin.template: - src: gitconfig.local.j2 - dest: "{{ ansible_user_dir }}/.gitconfig.local" diff --git a/roles/git/templates/gitconfig.local.j2 b/roles/git/templates/gitconfig.local.j2 deleted file mode 100644 index 9e0e4dd..0000000 --- a/roles/git/templates/gitconfig.local.j2 +++ /dev/null @@ -1,3 +0,0 @@ -[user] -email = {{ git_user_email }} -name = {{ git_user_name }} diff --git a/roles/github-cli/tasks/main.yaml b/roles/github-cli/tasks/main.yaml deleted file mode 100644 index 07eccff..0000000 --- a/roles/github-cli/tasks/main.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Existing install - ansible.builtin.stat: - path: /usr/bin/gh - register: install - -- name: Keyring - ansible.builtin.get_url: - dest: /usr/share/keyrings/githubcli-archive-keyring.gpg - mode: 644 - url: https://cli.github.com/packages/githubcli-archive-keyring.gpg - when: not install.stat.exists - become: true - -- name: Repository - ansible.builtin.apt_repository: - repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" - when: not install.stat.exists - become: true - -- name: Install - ansible.builtin.package: - name: - - gh - state: latest - become: true diff --git a/roles/github-desktop/tasks/main.yaml b/roles/github-desktop/tasks/main.yaml deleted file mode 100644 index bfe6d11..0000000 --- a/roles/github-desktop/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - io.github.shiftey.Desktop - method: user - state: present diff --git a/roles/gnome-tweak-tools/tasks/main.yaml b/roles/gnome-tweak-tools/tasks/main.yaml deleted file mode 100644 index 681ce50..0000000 --- a/roles/gnome-tweak-tools/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - gnome-tweaks - state: latest - become: true diff --git a/roles/google-chrome/tasks/main.yaml b/roles/google-chrome/tasks/main.yaml deleted file mode 100644 index 5f7b731..0000000 --- a/roles/google-chrome/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.google.Chrome - method: user - state: present diff --git a/roles/htop/tasks/main.yaml b/roles/htop/tasks/main.yaml deleted file mode 100644 index 67e45dd..0000000 --- a/roles/htop/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - htop - state: latest - become: true diff --git a/roles/jq/tasks/main.yaml b/roles/jq/tasks/main.yaml deleted file mode 100644 index 14b5912..0000000 --- a/roles/jq/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - jq - state: latest - become: true diff --git a/roles/kdenlive/tasks/main.yaml b/roles/kdenlive/tasks/main.yaml deleted file mode 100644 index fffa23d..0000000 --- a/roles/kdenlive/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - org.kde.kdenlive - method: user - state: present diff --git a/roles/mysql-client/tasks/main.yaml b/roles/mysql-client/tasks/main.yaml deleted file mode 100644 index b1a53c8..0000000 --- a/roles/mysql-client/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - mysql-client - state: latest - become: true diff --git a/roles/notion-app/tasks/main.yaml b/roles/notion-app/tasks/main.yaml deleted file mode 100644 index 6264a47..0000000 --- a/roles/notion-app/tasks/main.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Repository - ansible.builtin.apt_repository: - repo: "deb [trusted=yes] https://apt.fury.io/notion-repackaged/ /" - become: true - -- name: Install - ansible.builtin.package: - name: - - notion-app - state: latest - become: true diff --git a/roles/npm/tasks/main.yaml b/roles/npm/tasks/main.yaml deleted file mode 100644 index fb6eeb0..0000000 --- a/roles/npm/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - npm - state: latest - become: true diff --git a/roles/obs-studio/tasks/main.yaml b/roles/obs-studio/tasks/main.yaml deleted file mode 100644 index 2959151..0000000 --- a/roles/obs-studio/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.obsproject.Studio - method: user - state: present diff --git a/roles/pdf-arranger/tasks/main.yaml b/roles/pdf-arranger/tasks/main.yaml deleted file mode 100644 index 9f81f63..0000000 --- a/roles/pdf-arranger/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.github.jeromerobert.pdfarranger - method: user - state: present diff --git a/roles/platformsh-cli/tasks/main.yaml b/roles/platformsh-cli/tasks/main.yaml deleted file mode 100644 index 6973fda..0000000 --- a/roles/platformsh-cli/tasks/main.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- name: Install dependencies - ansible.builtin.package: - name: - - php - state: latest - become: true - -- name: Existing install - stat: - path: "{{ ansible_user_dir }}/.platformsh/bin/platform" - register: install - -- name: Download installer - ansible.builtin.get_url: - dest: /tmp/platformsh-install.sh - mode: 0755 - url: https://platform.sh/cli/installer - become: true - when: not install.stat.exists - -- name: Execute installer - ansible.builtin.command: php /tmp/platformsh-install.sh - when: not install.stat.exists - -- name: Remove platformsh-install.sh - ansible.builtin.file: - path: /tmp/platformsh-install.sh - state: absent - become: true diff --git a/roles/pocketcasts/tasks/main.yaml b/roles/pocketcasts/tasks/main.yaml deleted file mode 100644 index 69a9602..0000000 --- a/roles/pocketcasts/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - tech.feliciano.pocket-casts - method: user - state: present diff --git a/roles/postman/tasks/main.yaml b/roles/postman/tasks/main.yaml deleted file mode 100644 index 1128a0d..0000000 --- a/roles/postman/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.getpostman.Postman - method: user - state: present diff --git a/roles/projects/meta/main.yaml b/roles/projects/meta/main.yaml deleted file mode 100644 index 5b79f2a..0000000 --- a/roles/projects/meta/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: ssh diff --git a/roles/projects/tasks/main.yaml b/roles/projects/tasks/main.yaml deleted file mode 100644 index cc417e4..0000000 --- a/roles/projects/tasks/main.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: Create project directories - ansible.builtin.file: - path: "{{ project_directory_item }}" - state: directory - recurse: yes - loop_control: - loop_var: project_directory_item - with_items: "{{ project_directories | default([]) }}" - -- name: Clone projects - ansible.builtin.git: - accept_hostkey: yes - bare: "{{ project_item.bare | default(true) }}" - clone: yes - dest: "{{ ansible_user_dir }}/Code/{{ project_item.dest }}" - repo: "{{ project_item.repo }}" - version: "{{ project_item.version | default('main') }}" - update: no - loop_control: - loop_var: project_item - with_items: "{{ project_projects | default([]) }}" diff --git a/roles/pulumi/tasks/main.yaml b/roles/pulumi/tasks/main.yaml deleted file mode 100644 index 0c1dc2f..0000000 --- a/roles/pulumi/tasks/main.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Existing install - stat: - path: "{{ ansible_user_dir }}/.pulumi/bin/pulumi" - register: install - -- name: Download installer - ansible.builtin.get_url: - dest: /tmp/pulumi-install.sh - mode: 0755 - url: https://get.pulumi.com - become: true - when: not install.stat.exists - -- name: Execute installer - ansible.builtin.command: sh /tmp/pulumi-install.sh - when: not install.stat.exists - -- name: Remove pulumi-install.sh - ansible.builtin.file: - path: /tmp/pulumi-install.sh - state: absent - become: true diff --git a/roles/pv/tasks/main.yaml b/roles/pv/tasks/main.yaml deleted file mode 100644 index 78c398e..0000000 --- a/roles/pv/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - pv - state: latest - become: true diff --git a/roles/ripgrep/tasks/main.yaml b/roles/ripgrep/tasks/main.yaml deleted file mode 100644 index ee389d1..0000000 --- a/roles/ripgrep/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - ripgrep - state: latest - become: true diff --git a/roles/skype/tasks/main.yaml b/roles/skype/tasks/main.yaml deleted file mode 100644 index c9850b9..0000000 --- a/roles/skype/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.skype.Client - method: user - state: present diff --git a/roles/slack/tasks/main.yaml b/roles/slack/tasks/main.yaml deleted file mode 100644 index 9588720..0000000 --- a/roles/slack/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.slack.Slack - method: user - state: present diff --git a/roles/spotify/tasks/main.yaml b/roles/spotify/tasks/main.yaml deleted file mode 100644 index 6e53322..0000000 --- a/roles/spotify/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.spotify.Client - method: user - state: present diff --git a/roles/ssh/tasks/main.yaml b/roles/ssh/tasks/main.yaml deleted file mode 100644 index 44cc7d4..0000000 --- a/roles/ssh/tasks/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Copy SSH keys - copy: - content: "{{ ssh_key_item.value }}" - dest: "{{ ansible_user_dir }}/.ssh/{{ ssh_key_item.key }}" - mode: 0400 - loop_control: - loop_var: ssh_key_item - no_log: true - with_items: "{{ ssh_key | default({}) | dict2items }}" - -- name: Create SSH configuration file - ansible.builtin.copy: - content: "{{ ssh_config }}" - dest: "{{ ansible_user_dir }}/.ssh/config" - mode: 0400 - no_log: true - when: ssh_config is defined diff --git a/roles/stylua/meta/main.yaml b/roles/stylua/meta/main.yaml deleted file mode 100644 index fe55fc7..0000000 --- a/roles/stylua/meta/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: cargo diff --git a/roles/stylua/tasks/main.yaml b/roles/stylua/tasks/main.yaml deleted file mode 100644 index 63a110a..0000000 --- a/roles/stylua/tasks/main.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Install - community.general.cargo: - name: - - stylua - path: /usr/local - state: latest - become: true diff --git a/roles/tldr/tasks/main.yaml b/roles/tldr/tasks/main.yaml deleted file mode 100644 index 08ae98f..0000000 --- a/roles/tldr/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - tldr - state: latest - become: true diff --git a/roles/tmux/files/tmux.conf b/roles/tmux/files/tmux.conf deleted file mode 100644 index 83c4d3a..0000000 --- a/roles/tmux/files/tmux.conf +++ /dev/null @@ -1,95 +0,0 @@ -unbind C-b - -set -g prefix C-s -bind C-s send-prefix - -bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded" - -bind-key -n C-h select-pane -L -bind-key -n C-j select-pane -D -bind-key -n C-k select-pane -U -bind-key -n C-l select-pane -R - -set-option -g status-keys "emacs" -set-option -g default-terminal "xterm-256color" -set-option -ga terminal-overrides ",*256col*:Tc" - -bind-key h split-window -v -c '#{pane_current_path}' -bind-key v split-window -h -c '#{pane_current_path}' - -bind -n S-Left resize-pane -L 2 -bind -n S-Right resize-pane -R 2 -bind -n S-Down resize-pane -D 1 -bind -n S-Up resize-pane -U 1 - -bind -n C-Left resize-pane -L 10 -bind -n C-Right resize-pane -R 10 -bind -n C-Down resize-pane -D 5 -bind -n C-Up resize-pane -U 5 - -set-option -g status-left-length 50 -set-option -g status-right "" - -bind c new-window -c "#{pane_current_path}" - -set -g base-index 1 -set -g renumber-windows on - -# Break a pane into a new window. -bind-key b break-pane -d - -bind-key C-j choose-tree - -# Use vim keybindings in copy mode -setw -g mode-keys vi - -# Setup 'v' to begin selection as in Vim -bind-key -T copy-mode-vi 'v' send -X begin-selection -bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy" - -# Update default binding of `Enter` to also use copy-pipe -unbind -T copy-mode-vi Enter -bind-key -T copy-mode-vi 'Enter' send -X copy-pipe "reattach-to-user-namespace pbcopy" - -bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t" - -bind-key C-b send-keys 'tat && exit' 'C-m' -bind-key K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session' - -# Smart pane switching with awareness of Vim splits. -# See: https://github.com/christoomey/vim-tmux-navigator -is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" -bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' -bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' -bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' -bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' -tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' -if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ - "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" -if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ - "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" - -bind-key -T copy-mode-vi 'C-h' select-pane -L -bind-key -T copy-mode-vi 'C-j' select-pane -D -bind-key -T copy-mode-vi 'C-k' select-pane -U -bind-key -T copy-mode-vi 'C-l' select-pane -R -bind-key -T copy-mode-vi 'C-\' select-pane -l - -# Allow clearing screen with ctrl-l by using C-l -bind C-l send-keys 'C-l' -bind C-k send-keys 'C-k' - -# Enable mouse support. -setw -g mouse on - -# Remove delay when switching Vim modes. -set -sg escape-time 0 - -# Plugins -set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @plugin 'tmux-plugins/tmux-yank' -set -g @plugin 'tmux-plugins/tpm' - -# Initialize TMUX plugin manager -run '~/.tmux/plugins/tpm/tpm' diff --git a/roles/tmux/tasks/main.yaml b/roles/tmux/tasks/main.yaml deleted file mode 100644 index 68ee803..0000000 --- a/roles/tmux/tasks/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - tmux - state: latest - become: true - -- name: Directory - ansible.builtin.file: - path: "{{ ansible_user_dir }}/.config/tmux" - state: directory - -- name: Configuration - ansible.builtin.file: - src: "{{ role_path }}/files/tmux.conf" - dest: "{{ ansible_user_dir }}/.config/tmux/tmux.conf" - state: link diff --git a/roles/tmuxinator/tasks/main.yml b/roles/tmuxinator/tasks/main.yml deleted file mode 100644 index 1c7fd51..0000000 --- a/roles/tmuxinator/tasks/main.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Dependencies - ansible.builtin.package: - name: ruby - state: latest - become: true - -- name: Install - community.general.gem: - bindir: "{{ ansible_user_dir }}/.local/bin" - name: tmuxinator - state: latest - -- name: Configuration - ansible.builtin.file: - path: "{{ ansible_user_dir }}/.config/tmuxinator" - state: directory - -- name: Copy configuration files - copy: - content: "{{ tmuxinator_config_file.value }}" - dest: "{{ ansible_user_dir }}/.config/tmuxinator/{{ tmuxinator_config_file.key }}.yml" - mode: 0644 - loop_control: - loop_var: tmuxinator_config_file - no_log: true - with_items: "{{ tmuxinator_config | default({}) | dict2items }}" diff --git a/roles/todoist/tasks/main.yaml b/roles/todoist/tasks/main.yaml deleted file mode 100644 index 6c4a861..0000000 --- a/roles/todoist/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - com.todoist.Todoist - method: user - state: present diff --git a/roles/tree/tasks/main.yaml b/roles/tree/tasks/main.yaml deleted file mode 100644 index da6dd9f..0000000 --- a/roles/tree/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - tree - state: latest - become: true diff --git a/roles/vlc/tasks/main.yaml b/roles/vlc/tasks/main.yaml deleted file mode 100644 index 1c766ee..0000000 --- a/roles/vlc/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - org.videolan.VLC - method: user - state: present diff --git a/roles/zoom/tasks/main.yaml b/roles/zoom/tasks/main.yaml deleted file mode 100644 index 5b33b5d..0000000 --- a/roles/zoom/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install - community.general.flatpak: - name: - - us.zoom.Zoom - method: user - state: present diff --git a/roles/zsh-antigen/tasks/main.yaml b/roles/zsh-antigen/tasks/main.yaml deleted file mode 100644 index 957e1d6..0000000 --- a/roles/zsh-antigen/tasks/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Download - get_url: - dest: ~/.antigen.zsh - url: https://raw.githubusercontent.com/zsh-users/antigen/master/bin/antigen.zsh diff --git a/roles/zsh/files/.zshenv b/roles/zsh/files/.zshenv deleted file mode 100644 index bf0a74c..0000000 --- a/roles/zsh/files/.zshenv +++ /dev/null @@ -1,7 +0,0 @@ -export EDITOR=nvim -export ZDOTDIR="$HOME/.config/zsh" - -PROMPT_EOL_MARK='' -TERM=xterm-256color -WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' -ZLE_REMOVE_SUFFIX_CHARS='' diff --git a/roles/zsh/files/config/.zshrc b/roles/zsh/files/config/.zshrc deleted file mode 100644 index 5f2bd58..0000000 --- a/roles/zsh/files/config/.zshrc +++ /dev/null @@ -1,28 +0,0 @@ -for function in $ZDOTDIR/functions/*; do - source "${function}" -done - -sources=( - 'aliases' - 'colour' - 'functions' - 'fzf' - 'general' - 'history' - 'navigation' - 'nvm' - 'options' - 'path' - 'platformsh' - 'plugins' - 'prompt' - - 'post/completion' -) - -for s in "${sources[@]}"; do - source $ZDOTDIR/configs/${s}.zsh -done - -# Local config -[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local diff --git a/roles/zsh/files/config/completion-scripts/_g b/roles/zsh/files/config/completion-scripts/_g deleted file mode 100644 index 4eca8f3..0000000 --- a/roles/zsh/files/config/completion-scripts/_g +++ /dev/null @@ -1,3 +0,0 @@ -#compdef g -compdef g=git - diff --git a/roles/zsh/files/config/completion-scripts/_m b/roles/zsh/files/config/completion-scripts/_m deleted file mode 100644 index 98a3250..0000000 --- a/roles/zsh/files/config/completion-scripts/_m +++ /dev/null @@ -1,2 +0,0 @@ -#compdef m -compdef m=make diff --git a/roles/zsh/files/config/configs/aliases.zsh b/roles/zsh/files/config/configs/aliases.zsh deleted file mode 100644 index 728d483..0000000 --- a/roles/zsh/files/config/configs/aliases.zsh +++ /dev/null @@ -1,11 +0,0 @@ -alias hosts='sudo vim /etc/hosts' -alias rebase='git fetch --all --prune --prune-tags && git rebase' -alias sshconfig='vim ~/.ssh/config' -alias vim='nvim' - -# Allow for pasting lines of code that start with a dollar sign. -alias \$='' - -# Re-implement pbcopy and pbpaste from macOS. -alias pbcopy="xclip -selection clipboard" -alias pbpaste="xclip -selection clipboard -o" diff --git a/roles/zsh/files/config/configs/colour.zsh b/roles/zsh/files/config/configs/colour.zsh deleted file mode 100644 index 534b774..0000000 --- a/roles/zsh/files/config/configs/colour.zsh +++ /dev/null @@ -1,4 +0,0 @@ -autoload -U colors -colors - -export CLICOLOR=1 \ No newline at end of file diff --git a/roles/zsh/files/config/configs/functions.zsh b/roles/zsh/files/config/configs/functions.zsh deleted file mode 100644 index 0a3aecb..0000000 --- a/roles/zsh/files/config/configs/functions.zsh +++ /dev/null @@ -1,38 +0,0 @@ -function m() { - if [[ -f .notes/Makefile ]]; - then - make -f .notes/Makefile "$@" - else - make "$@" - fi -} - -function mkd() { - mkdir -p "$@" && cd "$@" -} - -function composer() { - docker run -u $UID -it --rm \ - -v $(pwd):/app \ - -v ~/.composer:/root/.composer \ - -v ~/.ssh:/root/.ssh \ - composer \ - composer $* -} - -# Run 'phpunit' or 'pest' depending on the project. -function p () { - vendor/bin/$(phpunit-or-pest) $*; -} -function pf () { - vendor/bin/$(phpunit-or-pest) --filter $* -} - -nv() { - if [[ $# > 0 ]]; - then - nvim $@ - else - nvim . - fi -} diff --git a/roles/zsh/files/config/configs/fzf.zsh b/roles/zsh/files/config/configs/fzf.zsh deleted file mode 100644 index 6b5afa9..0000000 --- a/roles/zsh/files/config/configs/fzf.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Include keybindings for fzf. -. /usr/share/doc/fzf/examples/key-bindings.zsh diff --git a/roles/zsh/files/config/configs/general.zsh b/roles/zsh/files/config/configs/general.zsh deleted file mode 100644 index 2651094..0000000 --- a/roles/zsh/files/config/configs/general.zsh +++ /dev/null @@ -1,5 +0,0 @@ -precmd() { - # Add a blank line before each command. - print '' -} - diff --git a/roles/zsh/files/config/configs/history.zsh b/roles/zsh/files/config/configs/history.zsh deleted file mode 100644 index d85faea..0000000 --- a/roles/zsh/files/config/configs/history.zsh +++ /dev/null @@ -1,7 +0,0 @@ -setopt histignoredups - -setopt inc_append_history - -HISTSIZE=10000 -SAVEHIST=10000 -HISTFILE=~/.cache/zsh/history diff --git a/roles/zsh/files/config/configs/navigation.zsh b/roles/zsh/files/config/configs/navigation.zsh deleted file mode 100644 index 3bbef6d..0000000 --- a/roles/zsh/files/config/configs/navigation.zsh +++ /dev/null @@ -1,9 +0,0 @@ -bindkey -s "^f" "tmux-sessioniser\n" - -# Search through history with the up and down arrows. -autoload -U up-line-or-beginning-search -autoload -U down-line-or-beginning-search -zle -N up-line-or-beginning-search -zle -N down-line-or-beginning-search -bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search # Up -bindkey "${terminfo[kcud1]}" up-line-or-beginning-search # Down diff --git a/roles/zsh/files/config/configs/nvm.zsh b/roles/zsh/files/config/configs/nvm.zsh deleted file mode 100644 index 8deff7e..0000000 --- a/roles/zsh/files/config/configs/nvm.zsh +++ /dev/null @@ -1,2 +0,0 @@ -export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" diff --git a/roles/zsh/files/config/configs/options.zsh b/roles/zsh/files/config/configs/options.zsh deleted file mode 100644 index 095835c..0000000 --- a/roles/zsh/files/config/configs/options.zsh +++ /dev/null @@ -1,3 +0,0 @@ -# Fix "zsh: no matches found: HEAD^" error. -# See https://github.com/opdavies/dotfiles/issues/14. -setopt NO_NOMATCH diff --git a/roles/zsh/files/config/configs/path.zsh b/roles/zsh/files/config/configs/path.zsh deleted file mode 100644 index 6eaa86a..0000000 --- a/roles/zsh/files/config/configs/path.zsh +++ /dev/null @@ -1,25 +0,0 @@ -setopt auto_cd - -export PATH=\ -$PATH:\ -/usr/bin:\ -$HOME/.cargo/bin:\ -$HOME/.composer/vendor/bin:\ -$HOME/.dotfiles/bin:\ -$HOME/.dotfiles/bin/bin:\ -$HOME/.local/bin:\ -$HOME/.platformsh/bin:\ -$HOME/.pulumi/bin:\ -$HOME/bin:\ -$HOME/snap/bin:\ -bin:\ -node_modules/.bin:\ -tools/php-cs-fixer/vendor/bin:\ -vendor/bin - -export CDPATH=\ -./:\ -$HOME/Code:\ -$HOME/Code/clients:\ -$HOME/Code/open_source:\ -$HOME diff --git a/roles/zsh/files/config/configs/platformsh.zsh b/roles/zsh/files/config/configs/platformsh.zsh deleted file mode 100644 index 8e8c2b6..0000000 --- a/roles/zsh/files/config/configs/platformsh.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# Platform.sh CLI configuration. -export PATH="$HOME/"'.platformsh/bin':"$PATH" - -if [ -f "$HOME/"'.platformsh/shell-config.rc' ]; then - . "$HOME/"'.platformsh/shell-config.rc'; -fi diff --git a/roles/zsh/files/config/configs/plugins.zsh b/roles/zsh/files/config/configs/plugins.zsh deleted file mode 100644 index 6a1243e..0000000 --- a/roles/zsh/files/config/configs/plugins.zsh +++ /dev/null @@ -1,10 +0,0 @@ -# antigen.zsh has been downloaded manually for now, -# see https://github.com/zsh-users/antigen/issues/659. -source $HOME/.antigen.zsh - -antigen bundle mollifier/cd-gitroot -antigen bundle zsh-users/zsh-autosuggestions -antigen bundle zsh-users/zsh-completions -antigen bundle zsh-users/zsh-syntax-highlighting - -antigen apply diff --git a/roles/zsh/files/config/configs/plugins.zsh.zwc b/roles/zsh/files/config/configs/plugins.zsh.zwc deleted file mode 100644 index 7a6ac081d644544e2d1de98ee459db18798ee0e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmdT>F;4<96z&y}l>s*W3DC*Jl@N`Kab!M^(rZ%M%e803m6$m24_I|z=O3{6lN|lt zamd9GgQHEp^y~ZHdwuQKK5I4EN5n1%SL~E^j-+w4%Y4Ju0Wv_OZYG7xCh?<|UJRan zDiUX>T6vL~LTT$M#)in{C~Ba`4LGd}pp17JTOdBgIR##U_nNk?X`hJqaNgH7_@Qoz z_`0TzYFY=p4-5gCV~d^Up!+u9w7e_wM6#FL`@3r~h;7hH+H(4evxmY?jAS!sjGk(l zi)6A=I^@oUy@toG3NLdnh{Z*4zEDc~pq=%{lM*+}jQl0R&uxgGR;gC00fM%Q#aU+N zOf*|(ZT<%z@l045jmrl!_HE^ /dev/null \ - || [[ "$(__git_prompt_git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then - return 0 - fi - - local ref - ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ - || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \ - || return 0 - - # Use global ZSH_THEME_GIT_SHOW_UPSTREAM=1 for including upstream remote info - local upstream - if (( ${+ZSH_THEME_GIT_SHOW_UPSTREAM} )); then - upstream=$(__git_prompt_git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}" 2>/dev/null) \ - && upstream=" -> ${upstream}" - fi - - echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" -} - -# Checks if working tree is dirty -function parse_git_dirty() { - local STATUS - local -a FLAGS - FLAGS=('--porcelain') - if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then - if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then - FLAGS+='--untracked-files=no' - fi - case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in - git) - # let git decide (this respects per-repo config in .gitmodules) - ;; - *) - # if unset: ignore dirty submodules - # other values are passed to --ignore-submodules - FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}" - ;; - esac - STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n 1) - fi - if [[ -n $STATUS ]]; then - echo "$ZSH_THEME_GIT_PROMPT_DIRTY" - else - echo "$ZSH_THEME_GIT_PROMPT_CLEAN" - fi -} - -# Gets the difference between the local and remote branches -function git_remote_status() { - local remote ahead behind git_remote_status git_remote_status_detailed - remote=${$(__git_prompt_git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/} - if [[ -n ${remote} ]]; then - ahead=$(__git_prompt_git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) - behind=$(__git_prompt_git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) - - if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then - git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE" - elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then - git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" - git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" - elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then - git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" - git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" - elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then - git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" - git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" - fi - - if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then - git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX${remote:gs/%/%%}$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" - fi - - echo $git_remote_status - fi -} - -# Outputs the name of the current branch -# Usage example: git pull origin $(git_current_branch) -# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if -# it's not a symbolic ref, but in a Git repo. -function git_current_branch() { - local ref - ref=$(__git_prompt_git symbolic-ref --quiet HEAD 2> /dev/null) - local ret=$? - if [[ $ret != 0 ]]; then - [[ $ret == 128 ]] && return # no git repo. - ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return - fi - echo ${ref#refs/heads/} -} - - -# Gets the number of commits ahead from remote -function git_commits_ahead() { - if __git_prompt_git rev-parse --git-dir &>/dev/null; then - local commits="$(__git_prompt_git rev-list --count @{upstream}..HEAD 2>/dev/null)" - if [[ -n "$commits" && "$commits" != 0 ]]; then - echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" - fi - fi -} - -# Gets the number of commits behind remote -function git_commits_behind() { - if __git_prompt_git rev-parse --git-dir &>/dev/null; then - local commits="$(__git_prompt_git rev-list --count HEAD..@{upstream} 2>/dev/null)" - if [[ -n "$commits" && "$commits" != 0 ]]; then - echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX" - fi - fi -} - -# Outputs if current branch is ahead of remote -function git_prompt_ahead() { - if [[ -n "$(__git_prompt_git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then - echo "$ZSH_THEME_GIT_PROMPT_AHEAD" - fi -} - -# Outputs if current branch is behind remote -function git_prompt_behind() { - if [[ -n "$(__git_prompt_git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then - echo "$ZSH_THEME_GIT_PROMPT_BEHIND" - fi -} - -# Outputs if current branch exists on remote or not -function git_prompt_remote() { - if [[ -n "$(__git_prompt_git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then - echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS" - else - echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING" - fi -} - -# Formats prompt string for current git commit short SHA -function git_prompt_short_sha() { - local SHA - SHA=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" -} - -# Formats prompt string for current git commit long SHA -function git_prompt_long_sha() { - local SHA - SHA=$(__git_prompt_git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" -} - -function git_prompt_status() { - [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]] && return - - # Maps a git status prefix to an internal constant - # This cannot use the prompt constants, as they may be empty - local -A prefix_constant_map - prefix_constant_map=( - '\?\? ' 'UNTRACKED' - 'A ' 'ADDED' - 'M ' 'ADDED' - 'MM ' 'MODIFIED' - ' M ' 'MODIFIED' - 'AM ' 'MODIFIED' - ' T ' 'MODIFIED' - 'R ' 'RENAMED' - ' D ' 'DELETED' - 'D ' 'DELETED' - 'UU ' 'UNMERGED' - 'ahead' 'AHEAD' - 'behind' 'BEHIND' - 'diverged' 'DIVERGED' - 'stashed' 'STASHED' - ) - - # Maps the internal constant to the prompt theme - local -A constant_prompt_map - constant_prompt_map=( - 'UNTRACKED' "$ZSH_THEME_GIT_PROMPT_UNTRACKED" - 'ADDED' "$ZSH_THEME_GIT_PROMPT_ADDED" - 'MODIFIED' "$ZSH_THEME_GIT_PROMPT_MODIFIED" - 'RENAMED' "$ZSH_THEME_GIT_PROMPT_RENAMED" - 'DELETED' "$ZSH_THEME_GIT_PROMPT_DELETED" - 'UNMERGED' "$ZSH_THEME_GIT_PROMPT_UNMERGED" - 'AHEAD' "$ZSH_THEME_GIT_PROMPT_AHEAD" - 'BEHIND' "$ZSH_THEME_GIT_PROMPT_BEHIND" - 'DIVERGED' "$ZSH_THEME_GIT_PROMPT_DIVERGED" - 'STASHED' "$ZSH_THEME_GIT_PROMPT_STASHED" - ) - - # The order that the prompt displays should be added to the prompt - local status_constants - status_constants=( - UNTRACKED ADDED MODIFIED RENAMED DELETED - STASHED UNMERGED AHEAD BEHIND DIVERGED - ) - - local status_text - status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)" - - # Don't continue on a catastrophic failure - if [[ $? -eq 128 ]]; then - return 1 - fi - - # A lookup table of each git status encountered - local -A statuses_seen - - if __git_prompt_git rev-parse --verify refs/stash &>/dev/null; then - statuses_seen[STASHED]=1 - fi - - local status_lines - status_lines=("${(@f)${status_text}}") - - # If the tracking line exists, get and parse it - if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then - local branch_statuses - branch_statuses=("${(@s/,/)match}") - for branch_status in $branch_statuses; do - if [[ ! $branch_status =~ "(behind|diverged|ahead) ([0-9]+)?" ]]; then - continue - fi - local last_parsed_status=$prefix_constant_map[$match[1]] - statuses_seen[$last_parsed_status]=$match[2] - done - fi - - # For each status prefix, do a regex comparison - for status_prefix in ${(k)prefix_constant_map}; do - local status_constant="${prefix_constant_map[$status_prefix]}" - local status_regex=$'(^|\n)'"$status_prefix" - - if [[ "$status_text" =~ $status_regex ]]; then - statuses_seen[$status_constant]=1 - fi - done - - # Display the seen statuses in the order specified - local status_prompt - for status_constant in $status_constants; do - if (( ${+statuses_seen[$status_constant]} )); then - local next_display=$constant_prompt_map[$status_constant] - status_prompt="$next_display$status_prompt" - fi - done - - echo $status_prompt -} - -# Outputs the name of the current user -# Usage example: $(git_current_user_name) -function git_current_user_name() { - __git_prompt_git config user.name 2>/dev/null -} - -# Outputs the email of the current user -# Usage example: $(git_current_user_email) -function git_current_user_email() { - __git_prompt_git config user.email 2>/dev/null -} - -# Output the name of the root directory of the git repository -# Usage example: $(git_repo_name) -function git_repo_name() { - local repo_path - if repo_path="$(__git_prompt_git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then - echo ${repo_path:t} - fi -} diff --git a/roles/zsh/tasks/main.yaml b/roles/zsh/tasks/main.yaml deleted file mode 100644 index 225e598..0000000 --- a/roles/zsh/tasks/main.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: Install - ansible.builtin.package: - name: - - zsh - state: latest - become: true - -- name: Set default - user: - name: "{{ ansible_env['USER'] }}" - shell: /usr/bin/zsh - become: yes - -- name: Configuration - ansible.builtin.file: - src: "{{ role_path }}/files/{{ zsh_config_item.src }}" - path: "{{ zsh_config_item.path }}" - state: link - loop_control: - loop_var: zsh_config_item - with_items: - - { src: config, path: "{{ ansible_user_dir }}/.config/zsh" } - - { src: .zshenv, path: "{{ ansible_user_dir }}/.zshenv" } - -- name: Delete old files - ansible.builtin.file: - path: "{{ old_files_item }}" - state: absent - loop_control: - loop_var: old_files_item - with_items: - - "{{ ansible_user_dir }}/.zsh" - - "{{ ansible_user_dir }}/.zshrc"